Developer: Roman Zapotockiy (dobbikov)
Upload files to server with ASP NET Core web api.
- BackEnd
- ASP NET Core
- FrontEnd
- React JS
- Install
- .NET Core SDK
- Node JS
- React JS -
npm install react-app
- Write to cmd:
npm install
- Start .NET Project
Upload photo with http rest api http://domain/api/Upload/Upload
Example:
const uploadPhotoHandler = async event => {
let fd = new FormData();
fd.append('formFile', event.target.files[0]);
fd.append('fileName', event.target.files[0].name);
const req = await fetch('/api/Upload/Upload', {method: 'POST', body: fd});
const data = req.json();
}