cURL / Mailing Lists / curl-and-php / Single Mail

curl-and-php

cURL problem

From: Mad Trax <traxmad_at_yahoo.com>
Date: Sun, 20 Jan 2008 04:40:19 -0800 (PST)

 Hello!
I'm trying to upload a video to putfile.com using CURL, but when I cilck the submit button , I'm redirected to the form upload page and not to an succesfull page.And the video isn't uploaded either.So basicaly the script doesn't upload the video or any values, it's only redirecting me to the upload form :(
Here is the code :

$postdata=array();
$postdata['username']="$user \n";
$postdata['imagefile']="@$video";
$postdata['txtTitle']="$title \n";
$postdata['category']="$category \n";
$postdata['SubmitImage']="Upload%20Media \n";
 
$ch = curl_init();
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt ($ch, CURLOPT_USERAGENT, "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)");
curl_setopt($ch, CURLOPT_COOKIEJAR, "mycookie.txt"); //initiates cookie file if needed
curl_setopt($ch, CURLOPT_COOKIEFILE, "mycookie.txt"); // Uses cookies from previous session if exist
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
curl_setopt($ch, CURLOPT_HEADER, TRUE);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION,TRUE); // follow redirects recursively
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_URL,"http://www.putfile.com/mediaupload");
curl_setopt($ch, CURLOPT_POSTFIELDS,$postdata);
$buf=curl_exec ($ch);
$error_no = curl_errno($ch);
curl_close ($ch);

       
---------------------------------
Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

_______________________________________________
http://cool.haxx.se/cgi-bin/mailman/listinfo/curl-and-php
Received on 2008-01-20