upload image with username from android to server using multipart post -
i want upload image , username android application server. developped code. in database find image without username ( value 0).i think should use asynctask have no idea how make it. want use method if it's possible. this code: public int uploadfile(string sourcefileuri) { string filename = sourcefileuri; string ref_name = "toto"; httpurlconnection conn = null; dataoutputstream dos = null; string lineend = "\r\n"; string twohyphens = "--"; string boundary = "*****"; int bytesread, bytesavailable, buffersize; byte[] buffer; int maxbuffersize = 1 * 1024 * 1024; file sourcefile = new file(sourcefileuri); if (!sourcefile.isfile()) { dialog.dismiss(); log.e("uploadfile", "source file not exist :" + imagepath); return 0; } else { try { // open url connection servlet fileinputstream fileinputstream = new ...