Football Fans: Download the 2012 Schedule App from Google Play!


Go Back   Android Forums > Android Development > Application Development > Developer 101

Developer 101 101 Tutorials



Reply
 
LinkBack Thread Tools
Old 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
Default 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.

nivie is offline  
Reply With Quote
Sponsors
Reply

Bookmarks


Go Back   Android Forums > Android Development > Application Development > Developer 101 User CP
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -5. The time now is 08:19 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Custom vBulletin Skins by: Relivo