Android - onUploadProgress showing 100% immediately but upload progress is still there

See original GitHub issue

Describe the issue

loaded parameter is 100% immediately but the upload process take some minutes after that only on android but for iOS its perfectly working.

Example Code

// Example code here
await axios({
            url: url,
            method: 'POST',
            data: formdata,
            // timeout: 60  30  1000,
            headers: {
                Authorization: 'Bearer ' + this.props.token,
                "Accept": "application/json",
                "Content-Type": "multipart/form-data",
            },

            onUploadProgress: function (progressEvent) {
                console.log("ProgressEvent: ", progressEvent)
                let percentage = Math.floor((progressEvent.loaded / progressEvent.total) * 100);
                // console.log("loaded", progressEvent.loaded)
                // console.log("total", progressEvent.total)
                console.log("PERCENTAGE ", percentage)
                self.setState({ progress: percentage, isFileUploading: true })
                if (percentage == 100) { }
            },
        })

Expected behavior, if applicable

onUploadProgress should show percentage till process executes.

Environment

  • Axios Version [e.g. 0.18.0]
  • Adapter [e.g. XHR/HTTP]
  • Browser [e.g. Chrome, Safari]
  • Browser Version [e.g. 22]
  • Node.js Version [e.g. 13.0.1]
  • OS: [e.g. iOS 12.1.0, OSX 10.13.4]
  • Additional Library Versions [e.g. React 16.7, React Native 0.63]

Additional context/Screenshots

Only android has this issue on iOS its perfectly working

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:3
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Alirez14commented, May 21, 2021

same here please have a look at this topic 🙏

0reactions
minhaj-arvensioncommented, Oct 11, 2022

Same issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

onUploadProgress showing 100% immediately but upload ...
Describe the bug i try adding upload progress but immediately 100%, but progress still not end. // Example code here let response: ...
Read more >
axios onUploadProgress returns immediately 100% progress ...
React Native android returns first 0% then immediately 100% progress for file upload but in the case of iOS it perfectly shows the...
Read more >
QUploader progress bar not updating realtime but at the end
The progress bar do not update on updateProgress call (during upload) but completes from 0 to 100% at the end of promise resolve....
Read more >
Displaying Upload/Download Progress in an Ionic Application
In this tutorial, we walk through how to display upload and download progress for HTTP requests.
Read more >
How To Make A Drag-and-Drop File Uploader With Vanilla ...
A demonstration of a web page in which you can upload images via drag and drop, preview the images being uploaded immediately, and...
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