Entry
How can i save an image from a remote web server to my web server?
Feb 22nd, 2008 20:14
dman, Articles Hosting, Pavel Prishivalko, Bjorn H, http://www.ttnr.org
Here's the snippet:
<?
$url_file = fopen("http://host/image.jpg",'rb');
$newfile_name = "/tmp/mydownload.file";
$newfile = fopen($newfile_name,'wb');
while (!feof($url_file)) {
$chunk = fread($url_file,1024);
fwrite($newfile,$chunk);
}
fclose($newfile);
fclose($url_file);
?>
in file "/tmp/mydownload.file" you will have the image you need
=========
openhosting.co.uk/articles/serverside/5854