Hello
I'm trying to write some code to upload video to YahooVideo!
I'm using cUrl..
Basically I go trough the following steps:
1 call the login page
2 get challenge and user values
3 send the login form
4 get the _crumb and Sig values
5 send the upload form
the login process is fine and I get the upload page.. but after submitting the upload form i get the following message
Please correct the following information:Your file was not uploaded successfully. Please try again
I check all the values I send .. and they are correct...
Any help??
this is the code I use to submit the form:
[php]
function UploadVideo_step2(){
$this->initCurl();
//set curl options
$this->url = "http://upload.video.yahoo.com/videoAPI/v1.0/Video.upload";
$this->cookieFile = $this->cookieFileJar;
$this->referer = "http://uk.video.yahoo.com/video/upload";
$this->numPostField = "16";
$this->follow = "1";
$doneUrl = urlencode("http://uk.video.yahoo.com/video/studio?action=upload");
$errorUrl = urlencode("http://uk.video.yahoo.com/video/upload");
$this->postFields = "_errorUrl=".$errorUrl."&Author=".$this->login."&MAX_FILE_SIZE=104857600&Region=uk&Channel s=3302376&Sig=".$this->sSig."&ClientID=".$this->login."&_crumb=".$this->sCrumb."&PartnerID=yvideo&VIDEOFILE=".urlencode($ this->sVideo)."&Title=".urlencode($this->sTitle)."&Description=".urlencode($this->sDescription)."&Transcript=&Categories=".urlencod e($this->sCategory)."&Tags=".urlencode($this->sTags)."&_doneUrl=".$doneUrl;
//submit form ***********************************************
if ($this->setCurlOption())
{
if (file_exists("c:\myfile.wmv")){
//echo "<br>submit video<br>";
$this->execCurl();
echo $this->outputContent;
}else{
echo "file doesn't exist" ;
}
}
$this->closeCurl();
}[/php]
thanks
Enclose your code within the appropriate code tags!! See the Posting Guidelines - moderator