Mag wrote:
Hi,
I got a pretty good code snippet from Zend to grap a
remote image and save it to disk, the problem is, when
it saves to my disk i am unable to open the
images...they are blank and the file matches the
remote images filesize...

[snip]

ob_start(); readfile($url); $img = ob_get_contents(); ob_end_clean(); $size = strlen($img);

[EMAIL PROTECTED]($filename, "a"); fwrite($fp2,$img); fclose($fp2);

I'm not sure what the problem is, but simplifying the code will help you track it down. Rather than messing with output buffering and fopen/fwrite/fclose, I'd suggest using the copy() function.


This line replaces the 8 lines above:

copy( $url, $filename );

--Rick

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Reply via email to