I am trying to copy a remote GIF supplied by advertisers to my local server but keep getting the following error ...
Warning: Unable to open 'GIF89aÔ<' for reading: No such file or directory
Here is the code I am using ...
$image = "url to a GIF";
$fp = fopen("$image","r+b"); # tried rb too
set_magic_quotes_runtime(0);
$fr = fread($fp,30000);
copy ($fr, "/local/dir/filename.gif");
chmod ("/local/dir/filename.gif", 0777);
fclose($fp);
set_magic_quotes_runtime(get_magic_quotes_gpc());
Any ideas?