HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://mobitracktechnologies.in/imagefiles.php");
StringBody data = new StringBody(textTosend, Charset.forName(HTTP.UTF_8));
MultiPartEntity entity = new MultiPartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);
ContentBody cbFile = new FileBody(filePath, "image/jpeg");
entity.addPart("file", cbFile);
entity.addPart("text", data);
httppost.setEntity(entity);
HttpResponse WSresponse = httpclient.execute(httppost);
问问题
92 次