question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upload progress handler for post requests

See original GitHub issue

For a post request it would be a great feature to be able to see the upload progress. Attaching some kind of handler to a request seems like the right way to do it: (progressValue) => do stuff api.post('url', data, (progressValue) => do stuff)

From the Axios docs:

// onUploadProgress allows handling of progress events for uploads onUploadProgress: function (progressEvent) { // Do whatever you want with the native progress event }

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

17reactions
skellockcommented, Feb 17, 2017

You can do this now. The 3rd parameter of post is handed right over to axios. So this would be something like:

api.post('url', data, { onUploadProgress: value => stuff(value) })
10reactions
ravirupareliyacommented, Jun 7, 2017

I am using it with React-Native.

Yes loaded and total worked for me. It is just not showing in JsonObject but i can use it directly like progress.loaded and progress.total

Read more comments on GitHub >

github_iconTop Results From Across the Web

Progress of Python requests post - Stack Overflow
I am uploading a large file using the Python ...
Read more >
File Upload Progress Bar with JS and PHP - CodeShack
In this tutorial, we'll be creating a multiple file upload interface with a progress bar using JavaScript (AJAX) and PHP.
Read more >
Upload Progress Bar (native alternative to Fetch ... - YouTube
Source code: https://openjavascript.info/2022/07/01/ upload - progress - bar -using-xhr-fetch-alternative/⚡ Looking for high-performance, ...
Read more >
Performing POST and file upload requests using URLSession
Just like that, we can now easily perform both simpler POST requests and file uploads, with progress events, using either Combine or a...
Read more >
Uploading files in React with Progress bar using Express server
If the user has a slow network or uploads a huge file, then they might need to wait for a longer period of...
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