Forum Moderators: coopster

Message Too Old, No Replies

Calculating free space available

         

Nutter

7:16 pm on Nov 29, 2006 (gmt 0)

10+ Year Member



Is there a way to tell how much space is remaining available for files? I'm working on a script that takes uploaded images and adds them to a database, but I'd like to check and make sure there's room for it first.

I think there's probably going to be some type of issue with quotas, because that's how I found the problem. A user had uploaded a test version and got an error that a folder could not be created because of insufficient space remaining.

And I know I could probably exec() out to df or something similar, but I would like it to work on Windows servers as well, so I'd prefer to keep it all in PHP code if possible.

justageek

7:21 pm on Nov 29, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Your answer may be here: [webmasterworld.com ]

JAG

eelixduppy

9:29 pm on Nov 29, 2006 (gmt 0)



disk_free_space [us2.php.net] may be something you want, too. :)

Nutter

2:57 pm on Nov 30, 2006 (gmt 0)

10+ Year Member



Thanks eelix, that looks like it is just what I'm looking for. It's amazing that no matter how many times I go through the function list at PHP.net to find something new I always seem to miss the one I'm looking for :)

[edited by: Nutter at 2:58 pm (utc) on Nov. 30, 2006]