Re: [PHP3] Download
| From: | (Richard Lynch) | Date: | Fri, 30 Jun 2000 18:40:50 +0000 |
| Subject: | Re: [PHP3] Download | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4094@lists.php.net to get a copy of this message | ||
In article
<NDBBIGPLILADLFDFGJEOEELFCKAA.matti.simperi@suomenwebpalvelut.fi>,
matti.simperi@suomenwebpalvelut.fi ("Matti Simperi / SWP") wrote:
> How can I download ex. zip-file (or any binary file) from another
> www-server? Please give me easy working example.
<?php
$file = fopen("http://www.whatever.com/some.zip",
'r') or die("Could not
find URL");
$out = fopen('/path/to/destination/some.zip', 'w') or die('Could not
create file');
while (!feof($file)){
$data = fread($file, 1000000);
fwrite($out, $data);
}
fclose($file);
fclose($out);
?>
--
Richard Lynch | If this was worth $$$ to you, buy a CD
US Customer Support Director | from one of the artists listed here:
Zend Technologies USA | http://www.L-I-E.com/artists.htm
http://www.zend.com | (this has nothing to do with Zend,
duh!)