note 25872 added to function.file-get-contents
| From: | ger dot Shaker at gmx dot net | Date: | Wed, 09 Oct 2002 16:25:01 +0000 |
| Subject: | note 25872 added to function.file-get-contents | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-37852@lists.php.net to get a copy of this message | ||
Here is my Code how to Copy a file from a website to
local harddisk without the file_get_contents function.
it is binary-safe, but its not the fastest way:
function filecopy($urlsrc,$localdst) {
$fp_urlsrc = fopen($urlsrc,"r");
$del_File = fopen($localdst,"w");
fwrite($del_File,"");
fclose ($del_File);
while (!feof($fp_urlsrc)) {
$fp_localdst = fopen($localdst,"a");
fwrite ($fp_localdst, fread($fp_urlsrc, 1));
fclose ($fp_localdst);
}
fclose($fp_urlsrc);
}
--
http://www.php.net/manual/en/function.file-get-contents.php
http://master.php.net/manage/user-notes.php?action=edit+25872
http://master.php.net/manage/user-notes.php?action=delete+25872
http://master.php.net/manage/user-notes.php?action=reject+25872