Monday, March 14, 2011

[android-developers] HttpPost fileupload data loss

The app sends up a data file to our server, using this code.

HttpParams params = new BasicHttpParams();
HttpConnectionParams.setConnectionTimeout(params, 15000);
HttpConnectionParams.setSoTimeout(params, 5 * 60 * 1000);
HttpClient client = new DefaultHttpClient(params);
HttpPost post = new HttpPost(MyActivity.HOST + "track/sync-
compare.html");
FileEntity e = new FileEntity(tmp, getContentType());
e.setChunked(true);
HttpEntity requestEntity = (e);
post.setEntity(requestEntity);
}
if (Util.LOG) debug("about to execute");
response = (HttpResponse) client.execute(post);
The file that is received on our server is different than the file
that is sent.

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate