Closed Thread Icon

Preserved Topic: PHP filesize() problem (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=20993" title="Pages that link to Preserved Topic: PHP filesize() problem (Page 1 of 1)" rel="nofollow" >Preserved Topic: PHP filesize() problem <span class="small">(Page 1 of 1)</span>\

 
lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 06-25-2001 13:06

Don't really know why this doesn't always / mostly work:

$fp = fopen("mylocalfile.bin");
$buf=fread($fp, filesize($fp));
fclose($fp);

the error occurs when PHP calls the filesize()...why is he failing to return the file size? but it's a local file?!

mr.maX
Maniac (V) Mad Scientist

From: Belgrade, Serbia
Insane since: Sep 2000

posted posted 06-25-2001 16:14

filesize() function expects filename as parameter, not file handle...

$fs = filesize("c:/max/max.txt");



[This message has been edited by mr.maX (edited 06-25-2001).]

lallous
Paranoid (IV) Inmate

From: Lebanon
Insane since: May 2001

posted posted 06-26-2001 15:02

Thanks mr. Max...
stupid me...i never took a look at it's syntax! though it needed a file handle instead.


« BackwardsOnwards »

Show Forum Drop Down Menu