koush / ion

Android Asynchronous Networking and Image Loading
Other
6.29k stars 1.04k forks source link

empty file #25

Closed UXDart closed 11 years ago

UXDart commented 11 years ago

Hi sometimes when uploading using POST to a java server (internal), I have a progress bar showing the upload, and when uploading files 250KB +/- I can see that it starts to upload the file, at 80% it stops for 2 seconds, and then it continues until 100%. then I see on server side that the file is empty. for example:

------------------------------eb03ed93a28c4317adb024dcb1850a3a Content-Disposition: form-data; name="file"; filename="takephoto.jpg" )

is this a bug in Ion? I checked and the file exists and has content. also I tried the same file several times, and it happens only sometimes. those times the progress bar stops for 2 seconds (at different moments) and continues. the other times it just uploads the file fast and works. any idea?

Thanks!

UXDart commented 11 years ago

is there anything I can test? if it starts uploading data and then stops for 2 seconds, should be some data in the file section? tnx

koush commented 11 years ago

I'll take a look this weekend and fix this

koush commented 11 years ago

This is definitely a bug

koush commented 11 years ago

Let me know what webserver you are using too

UXDart commented 11 years ago

I'm using internal servers, sorry. but for example, I tried on just a php file that accepts multipart forms. HTH

UXDart commented 11 years ago

Thanks!

koush commented 11 years ago

What webserver i mean? Apache? Node.js? Tornado?

UXDart commented 11 years ago

Oh... Apache

koush commented 11 years ago

What version of ion?

Where did you see this:

------------------------------eb03ed93a28c4317adb024dcb1850a3a Content-Disposition: form-data; name="file"; filename="takephoto.jpg" )

UXDart commented 11 years ago

I was using a version from 8 days ago I just updated to latest versions: https://github.com/koush/AndroidAsync/commit/acd3c9156c7ff4834e1a3ad1c1132e750ee44353 and https://github.com/koush/ion/commit/e1e195d208a3a45b3473e9737c9121db19e8477e

and I can't reproduce it. so maybe it was fixed by another fix... I tried 50 times. that response, is from a php that just accepts a multiform data form, and responds with what it received. so I can check if it is working and if not, what the server saw.

thanks

koush commented 11 years ago

Hm, ok thanks.

UXDart commented 11 years ago

sorry, but it happened again. is difficult to reproduce. but it happens. it stopped at 86% for 2 seconds, and then continue. but then the file was empty. :(

UXDart commented 11 years ago

for some reason I can reproduce this more often on 2.3 (I was testing on 4.2.2 before). it stops at 86% +/- and then continues the upload. but the server doesn't receive any content on the file.

UXDart commented 11 years ago

sorry... but something strange, on 2.3 it stops and continues at "86%" always at that same %.

koush commented 11 years ago

Will test on 2.3

UXDart commented 11 years ago

I finally found the problem. sorry for all the msgs. another process was deleting the file while it was being uploaded, that was the 2 seconds stop. for some reason it continued and then the server didn't have the file. thanks!!

koush commented 11 years ago

Haha, wow!