Note that there are some explanatory texts on larger screens.

plurals
  1. POHttpPost fileupload data loss
    primarykey
    data
    text
    <p>From my app I upload a file to our server using this basic code (it is a bit more than this of course but this is basically it)</p> <pre><code>HttpParams params = new BasicHttpParams(); HttpConnectionParams.setConnectionTimeout(params, 15000); HttpConnectionParams.setSoTimeout(params, 5 * 60 * 1000); HttpClient client = new DefaultHttpClient(params); HttpPost post = new HttpPost("upload url"); HttpEntity requestEntity = (new FileEntity(tmpFile, "multipart/form-data;boundary="+boundary); post.setEntity(requestEntity); HttpResponse response = (HttpResponse) client.execute(post); </code></pre> <p>That works fine MOST of the time. </p> <p>For some phones running Android 2.2+ the file received on the server side is not complete. Small portions of the file are simply missing, and the parts that are missing are at different locations of the file each time. </p> <p>We have verified this by comparing the file from the app against what is received on the server side. On the server side we captured packets with tcpdump to make sure it wasn't an issue with our web server or web server code. </p> <p>We also checked the data with tcpdump from the phone. The tcpdump file from the phone DOES differ from the data we are trying to send. For one case we did analysis on the tcpdump file is missing data between the address 8d68 and 9000 from the file. The packets from tcpdump line up with those addresses (one packet has a portion of the data up until 8d68 and then the next packet has data starting from 9000).</p> <p>For these phones the problem only happens some of the time. Sometimes file uploads work and the entire file is received intact on our end. </p> <p>This is happening ONLY for 2.2+ phones. It happens for a wide variety of phones, and a variety of carriers, and for hundreds of users. It appears to happen over both wifi and 3g based on the IP addresses seen on the server side.</p> <p>This is anecdotal but when trying to get this to happen on my Nexus over the past 2 days I have seen it happen 6 times and those times are always right around when I am entering or leaving the room close to a certain wifi router. The rest of the day when I'm in the office on a different wifi router or on a cell network the issue never happens. My theory being that the app is busy sending data and now we move from wifi to cell network or vice versa, is that a dumb idea or a possibility?</p> <p>I can put the tcpdump files and data files up somewhere if anyone cares to take a look.</p> <p>What else should I be investigating to figure out the reason for this?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload