listen to upload progress event, every 10% onUploadProgress
See original GitHub issueDescribe the question
How can I set a interval count to onUploadProgress
Example Code
axios.request( {
method: "post",
url: URL",
data: data,
responseType:'json',
onUploadProgress: (p) => {
this.setState({
progress: p.loaded / p.total
})
}
Expected behavior, if applicable Should listen to download progress event, every 10%
Environment:
- Axios Version [^0.18.0]
- Additional Library Versions [e.g. React 16.8.3, React Native 0.59.5]
Issue Analytics
- State:
- Created 4 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Implementing a file upload status progressbar with Axios ...
In the above code snippet, we are calling the onUploadProgress event with progressEvent as a parameter, which will in turn capture the loaded ......
Read more >how to get onUploadProgress in axios? - Stack Overflow
To see multiple upload progress events in development, create a custom Network Throttling Profile simulating uploading at 50KB/s: Custom > Add..
Read more >Axios upload progress with progress bar tutorial - YouTube
Source code: https://openjavascript.info/2022/06/06/ upload - progress -bar-with-axios/⚡ Looking for high-performance, affordable web hosting ...
Read more >Next.js file upload progress bar using Axios - Codersteps
In this article, you will learn how to get the upload progress ... api doesn't support listening to events that can help us...
Read more >Angular 10/9 File Upload Tutorial: Listen for HTTP Events ...
Angular 10/9 File Upload Tutorial: Listen for HTTP Events & Progress Bar Example. Angular Upload. In this tutorial, we'll learn how to ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Listen to all the events but only respond to them using modulus
Math.floor(written/total) % 10 === 0
. Since this may happen many times, also use a flag to check if event was emitted already?@liamm12 I had a look at the source and there is currently no native way of doing what you would like to within axios however I’m certain that you could intercept the native progress event and then handle that via an interval.