I have an application where the user can upload a file on a folder. Then my application must read how many data this user have available. I store in an interbase database the limit of his capacity. It all works fine, but with some archives i receive an error:
Warning: stat failed for the_uploaded_archive.ext (errno=2 - No such file or directory) in c:\the\path\of\my\application\my\script.php on line 19. I use a recursive function to see the size of the files stored. This is my function: function foldersize($mydir){ global $ID_USER,$connection,$size,$subdir; $sql="SELECT SIZE FROM USERS WHERE ID_USER=$ID_USER"; $query=ibase_query($connection,$sql) or die ("Invalid query"); $mysize=ibase_fetch_object($query); if(!isset($subdir)){ chdir("../files/$mydir"); }else{ chdir("$mydir"); } $handle=opendir("."); while($file=readdir($handle)){ if($file!="." and $file!=".."){ if(!is_dir($file)){ $size=$size+filesize($file); }else{ $subdir="yes"; $size=$size+foldersize("$file"); } } } closedir($handle); clearstatcache(); return $mysize->SIZE-round($size/(1024*1024)); } Does anybody know this error? _______________________________________________________ Antonio Vicente Maturana _______________________________________________________ Powered by Sambar Webmail - http://www.sambar.com) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]