Apps how to upload videos to DailyMotion??

nivie

Newbie
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()!=500)
upload=true;

inputstream.close();
}
}
catch (ClientProtocolException e) {
e.printStackTrace();
}
catch (IOException e) {
e.printStackTrace();
}


Please help.
Thanks in advance.
 
Top