2 /* This program is free software. It comes without any warranty, to
3 * the extent permitted by applicable law. You can redistribute it
4 * and/or modify it under the terms of the Do What The Fuck You Want
5 * To Public License, Version 2, as published by Sam Hocevar. See
6 * http://sam.zoy.org/wtfpl/COPYING for more details. */
12 if (!is_dir(FILE_DIR.$_SESSION['user_id'])) {
13 mkdir(FILE_DIR.$_SESSION['user_id']);
15 copy($_FILES['data_file']['tmp_name'],FILE_DIR.$_SESSION['user_id'].'/'.$_FILES['data_file']['name']);
16 return $_SESSION['user_id'].'/'.$_FILES['data_file']['name'];
22 * Returns disk usage in bytes of directory $d. Limit depth level with $depth.
23 * Updates, documentation and examples: http://daniel.lorch.cc/projects/disk_usage/
28 function disk_usage($d, $depth = NULL) {
32 if(isset($depth) && $depth < 0)
35 if($d[strlen($d)-1] != '\\' || $d[strlen($d)-1] != '/')
42 while($e = readdir($dh))
43 if($e != '.' && $e != '..')
44 $usage += disk_usage($d.$e, isset($depth) ? $depth - 1 : NULL);