On Jun 1, 2006, at 2:12 PM, Clinton Gormley wrote:

        my $req   = APR::Request::Apache2->handle($r);
        $req->read_limit($Read_Limit);
        $req->parse();

        if ($req->body_status eq 'Exceeds configured maximum limit') {
            die('Body exceeds max upload size');
        };

I have

my $error = $self->ctx->{'ApacheRequest'}->body_status(); # I stash a $r and $apr in a ctx obj that gets passed around my oop stuff
        if ( $error eq 'Exceeds configured maximum limit' )
        {
                $self->RESULT_FINAL__general( undef , 'Your file is too big.' );
                return;
        }

I don't have the readlimit/parse -- are they necessary? i call - >param() right as the libapreq object is instantiated, so I guess I get an auto-parse for free. and I use a POST_MAX on instantiation...

It works, I just always fear my code will be unreadable to others.


Reply via email to