sub uploadfile {
   &bytes;
   for ($i=1; $i<=5; $i++) {
        if ($q->param("file$i")) {
             $file = $q->param("file$i");
             $format_left = format_size($left);
             if (($left - (length($file))) < 0) {
                  &inerror("You are out of space in
your $format_limit limit, you only have $format_left
left.");
             }
             foreach $line (@badtypes) {
                  if ($q->param("file$i") =~ /$line/)
{
                       &inerror("Invaild file type");
                  }
             }
             $filename = $q->param("file$i");
             $filename =~ s/.*[\/\]//;
             open
(OUTFILE,">$user{'site_id'}/$filename") ||
&error("Could not create $filename: $!");
             lock(OUTFILE);
             binmode OUTFILE;
             while
($bytesread=read($file,$buffer,2024)) {
                  print OUTFILE $buffer;
             }
             close (OUTFILE);
        }
   }
} 
 


ok there is five upload fields, and when checking for
errors I say:


if (($left - (length($file))) < 0) { &inerror("You are
out of space in your $format_limit limit, you only
have $format_left left."); } 


Since this is like a file manager, say they have a
space limit of 10mb but there was only 1mb
left($left), and we find the length of the file and
minus by what is left, and if its less than zero then
there over it. Well what my trouble is, they well
upload a script and it will be over the limit it wont
say anything, but if they upload again while it is
over the limit then it will show the erorr. It
shouldn't be doing this. Any Ideas.  



=====


__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to