Skip to content Skip to sidebar Skip to footer

Uploading An Image To A Server In Android

I my app I am trying to send an image over a PHP server. The problem is the PHP programmers say that it should be sent as an data. Following is the code which I am currently using,

Solution 1:

Atlast i found the answer, i did a small mistake....In the above code i have changed only one word in the following line

outputStream.writeBytes("Content-Disposition: form-data; name=\"uploadedfile\";filename=\"" + pathToOurFile +"\"" + lineEnd);

In the above line the main part is the word "uploadedfile". This word must be specified by the php programmer or else the file which we are sending will not be replaced.

Please refer the here

Post a Comment for "Uploading An Image To A Server In Android"