I am developing a Helpdesk application, in this app I am able to read and reply for the tickets sent by the customer. Now I got a requirement, I have to upload a file also. I have a post url to reply for the ticket, I will use Namevaluepairs to attach message with the url..
nameValuepair("id",ticketId);(nameValuepair is the instance of BasicNameValuePair)
nameValuepair("subject",subject);
nameValuepair("reply",message);
If file is not there then it will be like the above code. If file is there I one more parameter comes for file. What I have to do is to attach a file and encode it and then include it into Namevaluepair…
nameValuepair("file",encodedfile);
How can I Upload the file to this app and encode it.
I got some resources to attach a file to the default android email client using email intent, that was not helpful for me.
Thanks in Advance
Uploading a file is more complicated than adding a name-value pair. You need to get the output stream of the request and write the file. You can find an example here.