I trying to upload multiple images about (5000 of size upto 50mb) and trying to figure out what would be the best way to do it.
right now i have this code:
if (files.length) {
files.forEach(file => {
const formPayload = new FormData()
formPayload.append('file', file.file)
try {
axios({
baseURL: 'http://localhost:5000',
url: '/file',
method: 'post',
data: formPayload,
onUploadProgress: progress => {
const { loaded, total } = progress
const percentageProgress = Math.floor((loaded / total) * 100)
dispatch(setUploadProgress(file.id, percentageProgress))
},
})
dispatch(successUploadFile(file.id))
} catch (error) {
dispatch(failureUploadFile(file.id))
}
})
}
but it uploads all images at once, it is alright to do so?