I am using the file upload component with a custom handler but have found no way from the docs to update the upload status of the files, it just stays as "Pending" for each file.
I am using a upload handler like below:
Code: Select all
const uploadFiles = (e) => {
const keys = []
e.files.map(f => {
return s3.putObject({
Bucket: <bucket_name_here>,
Key: <key_here>,
Body: f
}, function (err, data) {
if (err) {
console.log("Error", err);
}
if (data) {
console.log("Upload Success", data);
}
})
})
setAttachments(keys);
}
Code: Select all
<FileUpload
name="demo[]"
multiple
maxFileSize={2000000}
customUpload
uploadHandler={uploadFiles}
emptyTemplate={<p className="m-0">Drag and drop files to here to upload.</p>}
/>