phonegap/phonegap-android — Issue #269: FileUploadResult HTTP response code -1
Author: davidsyw
Created: 2011-10-15 21:29:40+00:00
State: open

I am using PhoneGap 1.1.0's FileTransfer API with a ballpark of 40Kbytes for each file transfer from my Android 2.2.1 smartphone. I am experiencing frequent failures sending data to my server (about 50% of the time, I get a failure).

Successful file transfer is indicated by PhoneGap FileUploadResult HTTP response code 200 (as returned by my server).

Failures take place in one of two ways. I get a PhoneGap FileTransferError CONNECTION_ERR (3). I get FileUploadResult HTTP response code -1. It is mostly the latter error case that I am seeing. When either of these two error cases occur, my server has not received any request (my server is listening on a TCP stream socket).

My server has been robustness tested with many requests from watchdog client code running separately from my PhoneGap smartphone app.

My Android smartphone is connected via WiFi to my wireless router which is DSL connected to the Internet. My smartphone is 3 feet from the wireless router. Speedtest from the smartphone show 3.5Mbps and 0.5Mbps download/upload speeds. My DSL connection is 24/7 solid and heavily utilized at times.

What does the HTTP response code -1 mean?

Does anyone have any ideas on what might be causing these frequent errors?
- Is it a PhoneGap/Android problem?
- Is it a WiFi communications problem?
- Is it my smartphone? It is about a month old and had been running for 28 days without power-down-restart. I powered down the smartphone and restarted, and I still get the frequent FileTransfer errors.