Closed Thread Icon

Preserved Topic: PHP filesize() problem Pages that link to <a href="https://ozoneasylum.com/backlink?for=20993" title="Pages that link to Preserved Topic: PHP filesize() problem" rel="nofollow" >Preserved Topic: PHP filesize() problem\

 
Author Thread
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