Hiya, anyone know whats up with my script? - i want it to upload to a site but its not doing anything. Shows this error Wystąpił błąd podczas wrzucania pliku. - meaning error with file upload <?php $url = "http://www.wrzuta.pl/pliki/dodaj"; $filename = "audio.mp3"; $cookiefile = "cookies.txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, "files_qnt=1&static=1&MAX_FILE_SIZE=157286400&file=".@$filename); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $res = curl_exec($ch); echo $res; curl_close($ch); ?> PHP: If this cannot work - is there any other method to upload to this site? Perl maybe? :S
@ps3ubo <?php $url = "http://www.wrzuta.pl/pliki/dodaj"; $cookiefile = "cookies.txt"; //path to file you want to upload $data['file'] = '@C:\xampp\htdocs\audio.mp3'; $data['MAX_FILE_SIZE'] = '157286400'; //etc.. $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.8.1.7) Gecko/20070914 Firefox/2.0.0.7"); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiefile); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiefile); curl_setopt($ch, CURLOPT_REFERER, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); $res = curl_exec($ch); echo $res; curl_close($ch); ?> PHP: