Filesize problem

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
Hi - I need to extract the filesize from some files on the webserver.

The directory structure is like this

 - Public_html
   - Downloads
   - Includes

All the files I want the size of are in Downloads

The php files are in Public_Html and the includes are in Includes.

A PHP file calls a file in Includes which tries to get the size of a
file in Downloads.

I am a bit unclear how to structure the file reference for the Filesave

It only works if I put the script itself in Downloads and run it from

In that case I've got


any bright ideas?

Many thanks

Re: Filesize problem

On 8 Feb 2005 09:42:20 -0800 wrote:

Quoted text here. Click to load it

If you script runs from public_html/, then the correct path is
Downloads/filename.doc. Even if you include code from Includes/,
it doesn't change the path, AFAIK.

You can use the absolute path as well... but I think that it will
only complicate matters. Also, a function instead of a include
may serve you better... you can pass the path to the function and
write some code there to handle the path better.

If you are having these problems because sometimes you run code
from one directory and sometimes you wanna run the same code from
another directory... then re-think your structure of files/dirs.

Re: Filesize problem

Thanks so much.

Problem solved.


Re: Filesize problem

*** escribió/wrote (8 Feb 2005 09:42:20
Quoted text here. Click to load it

You haven't told us what you do and how it fails.

-+ Álvaro G. Vicario - Burgos, Spain
+- (la web de humor barnizada para la intemperie)
++ Manda tus dudas al grupo, no a mi buzón
-+ Send your questions to the group, not to my mailbox

Site Timeline