Я хотел бы отправить многостраничную форму с видео и данными, такими как электронная почта и имя. Ниже приведен мой код, и он не работает, на сервере нет ответа
File file =new File(VideoPath);
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost(url);
try {
// Add your data
List<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>(2);
nameValuePairs.add(new BasicNameValuePair("Name", "LDGHT"));
nameValuePairs.add(new BasicNameValuePair("Email", "[email protected]"));
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
httppost.setEntity(new FileEntity(file, "video/mp4"));
// Execute HTTP Post Request
HttpResponse response = httpclient.execute(httppost);
} catch (ClientProtocolException e) {
// TODO Auto-generated catch block
} catch (IOException e) {
// TODO Auto-generated catch block
}