I would upgrade HTML::Mason.
ENHANCEMENTSRoman Vašíček wrote: Hi all, I want to limit upload size on my Apache2+Mason powered website depending to user category - eg: guest = 500kB, registered = 2MB, admin = 10 MB. I already found answered question on perlmonks.orghttp://www.perlmonks.org/index.pl?node_id=328687 but described solution seems to does not work with Apache2. Using presented code I get 500 error from server with message Can't call method "comp" on an undefined value for the line $m->comp('/lib/component'); Probably $m is not properly initialized... Currently I'm trying to use 'LimitRequestBody' in Apache configuration, but don't know how can I handle errors in my Mason code in case of this limit exceeds. Folowing code does not work if ($r->status == 413) { warn "Limit reached"; $m->print(qq(<p>Data volume exceeds the capacity limit</p>)); $r->status(200); return; } It seems to work - status is set correctly if I test it in component, but browser still get 413 response instead of 200 and generated HTML code have prepended error message generated by Apache(?). Versions used: Apache2 - 2.0.48 libapreq2 - 2.03_dev mod_perl - 1.99_14 HTML::Mason - 1.26 MasonX::Apache2Handler - 0.05 MasonX::Request::WithApache2Session - 0.04 Apache::Session - 1.54 Thanks Roman |