New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onUploadProgress will be 100% before uploading process finished #3469
Comments
Facing the same issue today. I found on google that some people said it happens because the file is uploaded very fast when you run your server on localhost. So you need to slow down your network to Slow 3G. I tried that with no luck, either. Would appreciate if anybody could give a pointer! Thank you! |
I see the same issue. The onUploadProgress will ramp up to 100 pretty quick on a large file, but watching the network tab the file is still sending for a long time after progress has said it was 100. Then finally the promise will return. This does not have anything to do with localhost. Just upload a large file to say S3 and you will see, the onUploadProgress calls will finish WAY before the actual promise, i.e. the data, has been transmitted. |
same here on react native please fix the issue :/ |
Unfortunately also still seeing this issue using Expo 41.0 and React Native. |
Same here. It will be great if anyone can post a work around on this issue. |
Same! |
Got the same issue! Any ideas? |
Running into the same problem. The promise returns when the file finished uploading but the progress callbacks are happening almost instantly. Using React Native. |
I found this closed issue on react-native. Not sure if it's related or if this issue simply cropped back up: |
i think it's not related to axios and upload, it's because your api server doing some thing else (for example resize or ...) and it's delayed. |
i test my backend api with ajax in the web side with the same api and it work fine. problem occurred when i use it in react-native |
The API we are hitting is a commercially available one for document management. We also hit is using Axios in a react PWA without any issues. I believe the issue lay in the combination of RN and Axios.
On Mar 28, 2022, at 02:51, Milad Aslani Somarin ***@***.******@***.***>> wrote:
i think it's not related to axios and upload, it's because your api server doing some thing else (for example resize or ...) and it's delayed.
i test my backend api with ajax in the web side with the same api and it work fine. problem occurred when i use it in react-native
—
Reply to this email directly, view it on GitHub<#3469 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AN6IKZUBGFTXVS25XEHU253VCF6KNANCNFSM4UU4WZ7Q>.
You are receiving this because you commented.Message ID: ***@***.***>
|
I'm pretty sure this is a RN issue specifically in Java. If I get some time I'm going to see about debugging it in the RN source code. |
So this is still not solved yet? I'm also stuck with this problem for quite a while now. |
I'm seeing this in RN on iOS, not just android. Just FYI. |
I am facing the same issue. Does anyone know the answer? |
do you find any solution? |
In my environment, I get the same problem with react, typescript. Is it the same for others? |
I am seeing this exact issue too. At first I was using The actual upload works correctly however the |
Hello again, I've figured this out. Just in case this helps someone else: The issue was occurring when running a development bundle on a metro server - axios/xhr was reporting on the status of the upload of the file to the metro proxy rather than to the final destination on the net. When I created an apk build everything worked correctly. |
sorry, I can't understand. do you mean that if I build a release apk it gonna be OK? |
Hello @milad145 - yes, in my case this only occurs when running it via Metro Bundler - i.e. a debug or development build. If you are able to edit your code and preview the changes immediately on save then you are using Metro Bundler. For me, when running a release build |
If the issue is with the xhr adapter, then the problem is not with Axios itself, but with the implementation of facebook/react-native#11853 |
I confirm the answer of @stharvey, in React Native the issue only occurs when running the app in debug mode, when running it in release mode the upload progress works as expected. |
I have the same problem on android
|
Hello @MohamedKamalOthman - can you confirm that this is happening on your release builds? This happens when running a debug build but should work correctly in release. |
Hello @stharvey - it's working on release builds but not on debug. |
Thanks for the update. As far as I am aware there is no way to get this working on debug builds. The debug server is acting as a proxy and the progress being reported is that initial transfer before being uploaded remotely. It's nothing to be concerned about. The upload will still work and the promise will be returned when the remote transfer is complete. |
i have the same issue using React js with vite |
Same issue using
|
I'm stuck with the same issue in Nuxt 3 while sending a json body to the backend |
Hello everyone, This issue is happen on DEV mode only, in production however the percentage calculation will work just fine. |
Can also confirm 🎉 , release builds do not have this issue. Spent a lot of time debuggin and trying different alternatives till I found this issue! |
Describe the issue
hey every body.
in the first, sorry for my poor english language.
i wrote some code for uploading some images and data together by formdata format in react-native.
and i use node.js in backend side and every thing is ok. i can upload images.
but problem has occurred when i want use
onUploadProgress
. thenloaded
parameter will be100%
immediately but the upload process take some minutes after that.just in record when i use ajax in js code it's will be perfect so the problem is not from backend side. and it occurred just in react-native and the images select and crop by
react-native-image-crop-picker
.here is my code:
Example Code
Expected behavior, if applicable
Environment
Additional context/Screenshots
The text was updated successfully, but these errors were encountered: