i’m creating an activity which needs to upload an image to a webservice using their api.
I found that if i use UrlEncodedFormEntity and send the image data through that. the webservice doesn’t receive that. ( at least it will not be able to read that .)
In fact if i add some vars to send with the image data ( like name of the file, filesize ) they can be read from the webservice but the image data still doesn’t appear if i try to read it serverside.
Right now i’m using UrlEncodedFormEntity with BasicNameValuePair as container for my data.
May be it will help you.
I’ve used the same functionality, but the web service was developed by me. I’ve post the image using the following:
I get the particular Bitmap icon and compress it in byte array like this:
Then create HttpPost and set the the entity.
Check the “Content-type” header. You must properly set it to whatever your service expect.