Featured post
IOException when Uploading Videos to YouTube via Java API -
i have been attempting upload videos youtube via javaapi using direct uploading. have been having problem when call insert() method, ioexception error message
"error writing request body server"
i have verified file object creating correct details in videoentry object. have been using fiddler monitor activity machine , no request made upload api problem not there. here summary of code using:
videoentry newvideo = new videoentry(); //defined video properties such title , description here. mediafilesource ms = new mediafilesource(videofile, "video/flv"); newvideo.setmediasource(ms); videoentry createdentry = settings.insert(new url(apiurl), newvideo);
the ioexception thrown on insert call (settings youtubeservice instance) , api url appears correct.
prior have succeeded in uploading video using c# api know video file valid.
--update apiurl value:
http://uploads.gdata.youtube.com/feeds/api/users/default/uploads
make videofile points correct local file. file(string) constructor won't verify exists. mediafilesource constructor , videoentry.setmediasource() method never check file valid. error message "error writing request body server" sounds insert method can not find body of message trying send.
file videofile = new file("..."); if (videofile.exists() == false) { system.err.println("fail"); }
to test if file exists.
- Get link
- X
- Other Apps
Comments
Post a Comment