I\'ve been searching around for the solution, and have come across the multipart and different setups, but I can\'t seem to get it working correctly.
Here\'s what I
This is what I did yesterday, maybe it will help
Bitmap bitmapOrg = images.get(0);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
String upload_url = prepare_upload_url();
bitmapOrg.compress(Bitmap.CompressFormat.JPEG, 90, bao);
byte[] data = bao.toByteArray();
HttpClient httpClient = new DefaultHttpClient();
HttpPost postRequest = new HttpPost(upload_url);
MultipartEntity entity = new MultipartEntity(
HttpMultipartMode.BROWSER_COMPATIBLE);
//Set Data and Content-type header for the image
entity.addPart("file",
new ByteArrayBody(data, "image/jpeg", "file"));
postRequest.setEntity(entity);
try {
HttpResponse response = httpClient.execute(postRequest);
//Read the response
String jsonString = EntityUtils.toString(response.getEntity());
Log.v(ProgramConstants.TAG, "after uploading file "
+ jsonString);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}