how to limit disk space per user in a PHP web application & CentOS
Posted
by solid
on Server Fault
See other posts from Server Fault
or by solid
Published on 2010-03-25T22:28:38Z
Indexed on
2010/03/25
22:33 UTC
Read the original article
Hit count: 412
we have a web application written in PHP and we want all our users to be able to upload images for e.g. 50MB.
We will create a directory structure so that every user has its own folder like app/user1/images app/user2/images ...
Now everytime a user uploads an image, we need to check if this is still allowed or not but we don't want 1000 users to continously scan our hard drive counting file sizes in their directory. So writing a script that counts all file sizes in a user directory is not an option I guess?
Is there an easier way to calculate used up space per user and limit our app accordingly?
© Server Fault or respective owner