Page 1 of 1

warning using filesize(), why?

Posted: Wed Dec 10, 2003 4:50 pm
by madmax
hi, guys this is my very first php program. i am trying to uplod a file ( using multipart/form-data abd check its size.

however i get this warning:

Warning: filesize() [function.filesize]: Stat failed for (errno=2 - No such file or directory) .

Code: Select all

<?php

require("dblib.php");
                             
db_connect("localhost", "cs318", "cs318", "fall2003");
    
file=fopen($File,"r");
$size= filesize($file);
echo '<br> size='.$size;

db_disconnect();

?>
i know it must be something very stupid...but what???

Posted: Wed Dec 10, 2003 5:15 pm
by microthick
file=fopen($File,"r");

Missing dollar sign.

Posted: Wed Dec 10, 2003 5:18 pm
by DuFF
Might want to edit the username and password :wink:

Posted: Wed Dec 10, 2003 6:56 pm
by JAM
DuFF wrote:Might want to edit the username and password :wink:
True, but try and hack those on localhost.... ;)