Trying to figure what\'s wrong with my codings. I followed a blog post from here.
I managed to get the codes to actually upload the file to a PHP web service. However, f
I had the same problem and just fixed it.
I found that using the HttpMultipartMode.BROWSER_COMPATIBLE
prevented the correct mimeType from being set in my request, when using a ByteArrayBody
for an image. I assume this is probably the same problem you are having.
When I changed this line:
MultipartEntity mp = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
to
MultipartEntity mp = new MultipartEntity();
then the mime type was set correctly and the service upload worked.
I see that people used the BROWSER_COMPATIBLE
for solving another problem, but hopefully you don't need it.