onUploadProgress is not working as expected in axios?

1.9k views Asked by At

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)
        })
    }
}
0

There are 0 answers