Preview of file drag drop react component
This is frontend file dropper include axios to send file and get its token
Internal project file upload process
The image describe simplified version of file upload handling for custom system...
This componnent helps to push file over API to backend to get tmp file token which is used to push file using form...
- Clone the repo
git clone https://github.com/damikun/React-File-DragDrop.git
- CD to project dir
cd .\File-DragDropper\
- Restore packages
yarn install
- Build and run demo
yarn run start
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
<FileDragDrop
className="text-gray-600"
accept="image/png"
multiple={false}
api_url="https://localhost:5001/api/Data/UploadFile"
onSuccess={(token, response) => {
setstate(token);
}}
onError={(type, message, object) => {
window.alert(`Type: ${type}, Messagbe: ${type}, Object: ${object}`)
if (type === "Exception") console.log(object);
setstate("");
}}
/>