note 57206 added to ref.curl

From: Date: Tue, 27 Sep 2005 07:40:14 +0000
Subject: note 57206 added to ref.curl
Groups: php.notes 
Request: Send a blank email to php-notes+get-95856@lists.php.net to get a copy of this message
I did a simple function for downloading files.I hope can bu useful.I use it in my server , almost dl speed : 400k /sn. <? /* - Yunus Emre Yilmaz */ function downloadFile($adres,$ad) { if (!extension_loaded(curl)) { die("Extension yuklu degil socket deneyebilirsin"); } $ch = curl_init("$adres"); if (!$ch) { die("Curl oturumu baslatamadim.."); } curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $data = curl_exec($ch); curl_close($ch); // baglantiyi kapa $islem = fopen("$ad", "a+"); fwrite($islem, $data); fclose($islem); if ($islem) { echo" Dosya basariyla yuklendi..."; } else { die("Dosya yuklenemedi"); } } // Example usage // downloadFile('http://www.ceviz.net/yns.rar','yns.rar'); ?> ---- Manual Page -- http://www.php.net/manual/en/ref.curl.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+57206 Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=added+to+the+manual Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=bad+code Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=spam Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=useless Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=non-english Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes&reason=already+in+docs Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+57206&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+57206&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#95856) next »