December 21st, 2011, 12:40 AM
|
#1 (permalink)
|
|
New Member
Join Date: Nov 2011
Posts: 10
Device(s):
Thanks: 0
Thanked 0 Times in 0 Posts
|
how to upload videos to DailyMotion??
Hi,
I am trying to upload videos to DailyMotion. It is giving internal server error.
I am not able to remove this error. I am giving the code i am using here.
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://www.dailymotion.com/upload");
ProgressMultipartEntity multipartentity = new ProgressMultipartEntity(this);
try {
multipartentity.addPart("file", new FileBody(videoFile));
multipartentity.addPart("title", new StringBody(title));
multipartentity.addPart("post", new StringBody("1"));
multipartentity.addPart("skin", new StringBody("api"));
httppost.setEntity(multipartentity);
System.out.println(" httppost: "+httppost.getURI());
HttpResponse httpresponse = httpclient.execute(httppost);
HttpEntity responseentity = httpresponse.getEntity();
System.out.println(" httpresponse: "+httpresponse+" responseentity: "+responseentity);
if (responseentity != null) {
InputStream inputstream = responseentity.getContent();
if(httpresponse.getStatusLine().getStatusCode()!=5 00)
upload=true;
inputstream.close();
}
}
catch (ClientProtocolException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}
Please help.
Thanks in advance.
|
|
|