我正在使用此代码发送图像文件和文本文件..i已经构建了java路径,但仍显示错误[关闭]

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);

Use the below

 MultipartEntity entity = new MultipartEntity(HttpMultipartMode.BROWSER_COMPATIBLE);

and import

 import org.apache.http.entity.mime.HttpMultipartMode;
 import org.apache.http.entity.mime.MultipartEntity;