 |
Forum PHP Romania - Discutii despre PHP, MySQL, Javascript, AJAX, etc Comunitatea PHP Romania
|
| Subiectul anterior :: Subiectul următor |
| Autor |
Mesaj |
MadTrax
Data înscrierii: 24/Oct/2007
Mesaje: 7
|
| Trimis: Dum Ian 20, 2008 3:09 pm Titlul subiectului: Problema cURL la upload de fisiere video |
|
|
Vreau sa uploadez la putfile.com un fisier video folosinf cURL si nu reusesc.De fiecare data cand fac click pe butonul upload , ma redirectioneaza catre pagina de upload in loc sa uploadeze fisierul video.Mentionez ca am folosit acest cod
si pt youtube.com si video.google.com si fisierul s-a uploadat fara probleme!
Cod:
$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);
|
|
| Sus |
|
PHPRomania Bot
Bot Member
Data înscrierii: 27/Dec/2007
Mesaje: 1
Locaţie: Server Google |
| Trimis: Mie Dec 26, 2007 7:01 pm Titlul subiectului: Ad |
|
|
|
|
|
| Sus |
|
| |
|