How to track progress of a file getting uploaded to NodeJs server .I am using multer in server side to upload files. ?
Do i need to send some kind of information to the
React Frontend
const formData = new FormData();
formData.append('myImage', this.state.imageData);
const config = {
onUploadProgress: progressEvent => console.log(progressEvent.loaded), // TO SHOW UPLOAD STATUS
headers: {
'content-type': 'multipart/form-data'
}
};
axios.post("/api/api/save-media", formData, config)
.then((response) => {
// do whatever you want
}).catch((error) => {
console.log(error)
});