I am working on file upload functionality , what I want to achieve when I select multiple files or single file I want to assign custom property to each File object custom property must be like percentage:0 to File object. I tried hard but didn't find any proper solution to resolve this issue. Could someone please help me how to resolve this issue .
Thanks
Code
addManualAttachments = (event) => {
let files = event.target.files
const fileList = Array.from(files)
if (fileList.length > 10) {
Swal.fire('Warning !', 'Maximum files upload limit is 10', 'warning')
return false
}
for (let i = 0; i < fileList.length; i++) {
if (this.validateFile(fileList[i])) {
this.setState((prevState) => {
return {
...prevState,
selectedFiles: this.uniqueFiles([...prevState.selectedFiles, fileList[i]]),
}
})
}
}
}