How to Read Chunked Data from Phone Gap File Upload in Android How to Read Chunked Data from Phone Gap File Upload in Android apache apache

How to Read Chunked Data from Phone Gap File Upload in Android


There's no difference between reading chunked data on the server side vs non-chunked. it's just the way the phone sends the data (in chunks of 8192 bytes, or as one stream).

There's a LOT of chatter around this feature on the web, and personally I've found the whole fileupload solution to be a bit flaky, especially on bigger files (for instance, video files).

Some people report it happens on files bigger than 4.8mb, on my android phone it happens around the 8mb mark.

When my app uploads files and there is no file attached (this is what happens in a connection error 3 scenario) i log it, so I can see the phones that are having issues. it happens with iphones too (certain models).

If you look at the android logs when it happens, you may well see an out of memory exception too.

How does this help you? it doesn't, really - but hopefully it helps explain what the problem is. Unfortunately there's not much we can do about it - apart from contributing to the phonegap source code and re-writing the filetransfer method!

Out of interest, on the phone you're having issues with, can you upload massive files using, say, facebook, without an issue? However that app is uploading files is surely the way that phonegap should be doing it..


I've also experienced this issue. The file uploads fine in iOS, so the server is handling chunkedMode there, but on Android the fileupload returns "3" for connection error. I've tried the solution here: Phonegap : FileTransfer.upload() fails on Android, but no luck either.


It ended being an webserver issue. Apache needs to be configured to support chunked mode. Also note that NGNIX does not have chunked mode support by default you would need to install a module http://wiki.nginx.org/HttpChunkinModule