Page 1 of 1

filesize() [function.filesize]: stat failed for

Posted: Sun May 20, 2007 2:37 pm
by psychotomus
the error:
Warning: filesize() [function.filesize]: stat failed for http://image.com.com/gamespot/images/20 ... een001.jpg in /mounted-storage/home45b/sub001/sc18478-RGIJ/www.po2upload.com/mytest.php on line 36

Warning: fread() [function.fread]: Length parameter must be greater than 0 in /mounted-storage/home45b/sub001/sc18478-RGIJ/www.po2upload.com/mytest.php on line 36


my code

Code: Select all

$handle = fopen('http://image.com.com/gamespot/images/' . str_replace('/"', "",$urls[$i]), "rb");
		$contents = fread($handle, filesize('http://image.com.com/gamespot/images/' . str_replace('/"', "",$urls[$i]) ) );
		fclose($handle);


whats the error mean? How can I download that file from the url?

Posted: Sun May 20, 2007 2:40 pm
by Chris Corbyn
file_get_contents().

You can't get the size of a file over HTTP without reading the Content-length header. file_get_contents() will do what you're trying to do.