Hi everyone,

First off, I know little about the PHP syntax, I do most of my work in ASP but this PHP project fell on my shoulders.

I have a variable called $myFile that is created from a function that basically takes a URL and gives me the name of the file at the end of the URL. The files are text, MS WORD, EXCEL, PPT documents...I am trying to get the file size of the documents to show up using this syntax: filesize($myFile)

But I get the following error when I open the page with my coce:

Warning: filesize(): Stat failed for 3G_Key_Milestones.xls (errno=2 - No such file or directory) in /db/WWW/myDoc/brw/simpleweb/index2.php on line 2173

Any clue to what is going on?

thank you

SR

    You don't have a file named 3G_Key_Milestones.xls in the directory you're looking in?

    At least, that's what the error message is saying and that's the only clue as to what's going on.

      This is the problem, because I manually copied a file to the same directory as the page with the function and it worked. The problem is, the page with the function lies at the root of my web directory and there are many folders and subfolders that my page pulls, via a search feature and needs to display their file size. How can I compensate for files not being in the same directory as my function?

        Exactly as you would normally do it in any filesystem.
        [man]chdir[/man], or just supply the path along with the filename.

          Write a Reply...