Hi I am trying to upload a file from my android device to a web server using php. I've achieved it using MultiPartEntry and accessing the file in php using $_FILES. However, since using this approach the uploaded file has a very large resolution.
At present I capture the photo, resize it and convert it to a byte array. I could re-save the bitmap to a file and then upload the file using the above approach. However, since I already have bitmap as a byte array and its possible to add it to the MultipartEntry I thought this would be a better solution.
http://vikaskanani.wordpress.com/2011/01/29/android-image-upload-activity/
Android:
MultipartEntity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
ByteArrayOutputStream bao = new ByteArrayOutputStream();
bm.compress(Bitmap.CompressFormat.JPEG, 100, bao);
byte [] ba = bao.toByteArray();
entity.addPart("image", new ByteArrayBody(ba, "photo.jpg"));
My question is how do I access the image date in the http post?
Many thanks