1

My user will able to upload big amount of file to aws for that I have to show upload progress bar.But axios is showing the total value while uploading..I don't why this showing the total value while it is uploading to AwsS3

const config = {
    onUploadProgress:function (progressEvt) {
        console.log(progressEvt.loaded)//Showing total value while uploading
    }

}
export function uploadtoCdnAndSaveToDb(data) {
    return dispatch => {
        dispatch(showUnderLoader(true));
        return axios.post('/posttodb',{data:data},config
        ).then(response => {
                console.log(response.data)
        })
    }
}
Nane
  • 2,370
  • 6
  • 34
  • 74
  • Some things to consider: Does your browser support axios' `onUploadProgress` feature? Are you uploading lots of small files (in which case they might complete before `onUploadProgress` is called) or one large file? – Chris Watts Dec 14 '16 at 18:01
  • I am Uploading many large files – Nane Dec 14 '16 at 18:18
  • Can you paste your console log after you run this? Also make sure that console.log() is a valid call from onUploadProgress - I know in some circumstances it won't work. Try to set some other flag just to test. – Chris Watts Dec 15 '16 at 13:11

0 Answers0