cURL PHP Upload Issues -
i'm trying make plain curl upload hugefiles.net, no luck.
i have set $data['srv_tmp_url'] manually, (hope can done so) , upload_id parametar, avoid page scraping now.
when script executes redirect me download link, file on link there contains 25 b. here code, hope can try , point out mistakes making, thanks.
<?php function upload_curl($url,$data) { $ch = curl_init(); curl_setopt($ch, curlopt_url, $url); curl_setopt($ch, curlopt_timeout, 1000); curl_setopt($ch, curlopt_returntransfer,true); curl_setopt($ch, curlopt_ssl_verifypeer,false); curl_setopt($ch, curlopt_post, true); curl_setopt($ch, curlopt_postfields, $data); curl_setopt($ch, curlopt_followlocation, true); curl_setopt($ch, curlopt_referer, "http://hugefiles.net/"); $result = curl_exec($ch); return $result; } $filename = "test.rar"; $data = array(); $data['upload_type'] = "file"; $data['srv_tmp_url'] = "http://us02.hugefiles.net/tmp"; $data['file_0; filename="'.$filename.'"'] = "@c:/xampp/htdocs/test.rar"; //$data["sess_id"] = ""; echo upload_curl("http://us02.hugefiles.net/cgi-bin/upload.cgi?upload_id=310423971419&js_on=1&utype=&upload_type=file",$data); ?>
Comments
Post a Comment