11-15-2010 10:40 AM
I have been trying for awhile to upload large files to a webserver via the POST method. Everything works great, but in some devices the upload fails as it can't upload the 1MB file within the 120 second timeout.
Therefore, I want to upload the file in chunks so that as long as I upload a chunk within the 120 second timeout I will be okay. I am open to other solutions however.
This post has gotten me the closest, but I am having the same problems. I upload the first chunk and then once I issue the out.flush() command it will close the connection. I can't find a way to flush the buffered output without closeing the connection. This post mentions the solution is to "use SocketConnection write data to OutputStream and flush() would work. But only if Content-Length is calculated accurately and that server request is also correctly formatted."
Does anyone have any sample code or suggestions on how to do this?
It looks like the person in this post was trying to do what I want to do, but didn't have any luck either.