I would like to upload chunked files using React-Dropzone. I have the following code:
OnDrop:
const dropTest = async (file, rejectedFiles) => {
var formData = new FormData();
formData.append('file', file);
try {
const response = await fetch(appContext.api_url + 'ApiUser/fileUpload', {
method: 'POST',
body: formData
})
const result = await response.json();
} catch (error) {
console.error('Error:', error);
}
}
Render:
<Dropzone onDrop={dropTest} chunking={true}>
{({getRootProps, getInputProps}) => (
<section>
<div {...getRootProps()}>
<input {...getInputProps()} />
<p>Drag 'n' drop some files here, or click to select files</p>
</div>
</section>
)}
</Dropzone>
Dropzone library has an api, name of {chunking: true}, but It's not working on react-dropzone, how can I archieve this?
If it is not possible with React-Dropzone, I can get suggestions about another chunking upload solutions for react.