* B10m <[EMAIL PROTECTED]> [2005-10-18 23:48:11+0200]
[file uploads: $CGI::POST_MAX trapping not working with CAP - CGI.pm]

Mmm, I was messing with it and posted my previous message too fast, I
suppose, 'cause I have found a workaround now. Instead of using
CGI.pm (which doesn't provided needed results), use CGI::Simple.

sub cgiapp_get_query {
   my $self = shift;

   require CGI::Simple;
   $CGI::Simple::POST_MAX=1024 * 500; # 500K
   $CGI::Simple::DISABLE_UPLOADS=0;
   my $q = CGI::Simple->new();

   return $q;
}

and somewhere in your runmode:

   if($self->query->cgi_error()) {
      warn($self->query->cgi_error());
      # ... do whatever
   }

The warning I get now is:
413 Request entity too large: 1439225 bytes on STDIN exceeds $POST_MAX! ...

Smaller files get through, which seems to be exactly what we want.

Still I have no clue why this doesn't seem to work with CGI, but oh
well, if you're not bound to it, switch to CGI::Simple (should be
improving your performance anyways).

-- 
B10m
   'Google is Evil'
   -rw-rw-rw-  1 satan demons  0 Jun 06 06:06 google

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to