0

i want so set a limit on a folder which is being created by the user:

according to script below:

$root = "/users/homedir/";
if (!is_dir($root))
{
    @mkdir("users/homedir/", 0777);

The folder homedir should contain max 20 Mb of storage. If this is reached, the user can not upload into that folder anymore. How can i set those 20 Mb limit to that folder when it is created?

Jack Maessen
  • 1,780
  • 4
  • 19
  • 51
  • 1
    You can't set the limit on folder creation. You will need to monitor the size of the directory via other code. See http://stackoverflow.com/questions/478121/php-get-directory-size – skrilled Apr 21 '16 at 19:17

1 Answers1

0

You can't set a limit at the time of creation, but you can check the directory size along with the size of the file being uploaded, and limit based on those values.

Community
  • 1
  • 1
mister martin
  • 6,197
  • 4
  • 30
  • 63