Glancing through the XS source, it returns HTTP_REQUEST_ENTITY_TOO_LARGE which has a value of 413 (and thus is true for perl). What you want to do is make sure it's returning OK instead.

<%perl> my $apr = Apache::Request->instance( $r, POST_MAX => 1 ); my $status = $apr->parse(); if( $status != Apache::Constants::OK ) { print "Too big"; } else { print "Just right."; } </%perl>

Update: As a somewhat related aside, if you're using HTML::Mason::ApacheHandler the $r global should already be upgraded to an Apache::Request instance for you by default (or you can explicitly request this by passing args_method => "mod_perl", but that's the default setting; the other option is to set it to CGI to get a CGI.pm instance).

Another Update: Looking into what HTML::Mason::ApacheHandler does, it appears it already calls Apache::Request->instance() with no extra arguments. This might explain your problem (i.e. the instance is created and possibly already parsed before your size limitation is seen). If that's the case you might need to subclass HTML::Mason::ApacheHandler to override the prepare_request() method yourself.

package My::ApacheHandler; use base 'HTML::Mason::ApacheHandler'; sub prepare_request { my $self = shift; my $r = shift; Apache::Request->instance( $r, POST_MAX => 1 ); return $self->SUPER::prepare_request( $r, @_ ); } 1;

In reply to Re: Mason upload limit size by Fletch
in thread Mason upload limit size by physi

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.