onUploadProgress is not working as expected ?

See original GitHub issue

hi, 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)
        })
    }
}

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

6reactions
johnmercedcommented, May 12, 2017

I’m having the same issue!

Here’s a GIF to demonstrate it: img

My code looks similar to this:



// Progress
 var config = {
     onUploadProgress: function (progressEvent) {
          let percentCompleted = Math.round((progressEvent.loaded * 100) / progressEvent.total)
          console.debug('onUploadProgress called with', arguments, 'Percent Completed:' + percentCompleted)
     }
}

// Call API
axios.get(endpoint, data, config)
2reactions
rubennortecommented, Jan 6, 2017

What browser are you using? Are you sure it supports progress events?

I’d also try using something like:

const config = {
    onUploadProgress:function (progressEvt) {
        console.log('onUploadProgress called with', arguments);
    }
};

So you will always show a message and it will be easier to debug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

axios onUploadProgress and onDownloadProgress not ...
So far, everything works as expected, and it especially works with the CORS thing. Now I would like to track the progress of...
Read more >
Add upload progress to axios request - The Coders Blog
The onUploadProgress event is triggered when the upload process is in progress. The event object contains the following properties:.
Read more >
Networking.UnityWebRequest.uploadProgress - Unity - Manual
Is something described here not working as you expect it to? It might be a Known Issue. Please check with the Issue Tracker...
Read more >
Axios onUploadProgress not sending multidata/form-data
It essentially sends some files and expects another in return. It works fine however, I wanted to track the progress of the request...
Read more >
Install PECL uploadprogress | Drupal.org
PECL uploadprogress bar appears, but it is not showing progress? ... Drupal 10 is expected to launch on 14 December! Check out the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found