warning using filesize(), why?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
madmax
Forum Newbie
Posts: 1
Joined: Wed Dec 10, 2003 4:50 pm

warning using filesize(), why?

Post 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???
microthick
Forum Regular
Posts: 543
Joined: Wed Sep 24, 2003 2:15 pm
Location: Vancouver, BC

Post by microthick »

file=fopen($File,"r");

Missing dollar sign.
User avatar
DuFF
Forum Contributor
Posts: 495
Joined: Tue Jun 24, 2003 7:49 pm
Location: USA

Post by DuFF »

Might want to edit the username and password :wink:
User avatar
JAM
DevNet Resident
Posts: 2101
Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:

Post by JAM »

DuFF wrote:Might want to edit the username and password :wink:
True, but try and hack those on localhost.... ;)
Post Reply