-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Upload multiple files cause server side error : "Stream ended unexpectedly" #332
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
Comments
Hello, are you using maven provided snapshot or repository? |
Hi, smarek , I got latest code from the repository. |
Is it possible, you'd test out how many of the file was submitted ? Compare files in bytes on both ends of communication if necessary. And one more thing, you say when I uploading lots of image files to server, what is the count estimate? Is it tens or hundreds or thousands? How large files, over how fast network? If I were you, I'd try to send one file at a time and keep the buffer, and probably you can try reducing the count of parallel threads ran by android-async-http, to test out if parallelism doesn't cause any issues in your case. |
Maybe try to find out how many bytes was supposed to be transfered and how many was transfered, I expect possibly some problem with writing bounds in multipart post. |
@smarek , I'm sorry for long time no replying your sug, I was busy with a project in last few days. |
Upload was parallel I suppose, can you find out how to upload proceeded? Meaning if the data transfered correctly, if there was start or end missing, on how many of the 15 files? |
You should be able to monitor upload progress via onProgress callback on AsyncHttpResponseHandler, you say it's near to 100%, is it repeatable error? How much close to 100% Please try to investigate a little bit more, I'd really like to help you, but I need more information. |
And one more question, do you use single request for each file or single request with all files? |
I have the same issue; RequestParams params = new RequestParams();
final File icon = new File(new URI(element.getIcon()));
final File preview = new File(new URI(element.getPreview()));
final File file = new File(new URI(element.getFile()));
params.put("file", file);
params.put("preview", preview);
params.put("icon", icon);
client.post(API_URL, params,
new AsyncHttpResponseHandler() { Exception on the server side (Spring MVC + Commons Fileupload)
In this case total size of 3 files was 433795 bytes. |
@sozonnyk where did you get those sizes? (433795, 434407) Could you possibly try to dump whole data on server side and see what part of request is malformed? I'll try to set up some debug environment in meantime. |
Android Upload File Code :
Problem: When you upload equal and more than three, some characters of boundary When you upload two files :
When you upload three files :
|
Wrong length calculated when uploading files, Closing #332
With latest code, when I uploading lots of image files to server, cuase this problem, server console shows log:
It always happen when uploading progress goes to 100%.
Device: Sony Ericsson Xperia Arc S
Server: Apache Tomcat 6.0
thanks!
The text was updated successfully, but these errors were encountered: