Hi All,
I'm try to retrieve a remote file and create a local copy of it, It seems to work but when viewing the local copy of the file, i can't seem to read it.
For example... my script is...
$blob = "";
if ( ! $rfp = fopen("$file","rb") )
die("Unable to open remote file");
while (!feof ($rfp))
$blob .= fgets ($rfp, 1024);
fclose($rfp);
if ( ! $lfp = fopen("filestore/$folder/$filename","wb") )
die("Unable to write to open local file for writing");
if ( ! $bytes = fwrite($lfp, $blob, strlen($blob)) )
die("Unable to write to local file");
print "Done! $bytes written";
fclose($lfp);
The script does not produce any error messages, but when viewing the local copy of the file (for ex. an image) i just get a broken image link.
Please help, i'm slowly going mad!!
Cheers, mrJ