J. Shirley wrote:
On 7/10/07, Jim Spath <[EMAIL PROTECTED]> wrote:
I would like to place a maximum file size limit on uploads, but am not
quite sure how to go about this in Catalyst.
I've done this in CGI scripts by reading in chunks of the file until I
hit some size limit, but couldn't find anything in the Catalyst docs.
Thanks!
- Jim
Hi Jim,
A better approach would be to configure the webserver to do this, that
way you aren't tying up your application.
As an example, if you use Apache simply do:
LimitRequestBody 1048576
-Jay
Jay,
Using the webserver is a definite possibility, and something we should
put in place anyways, to restrict large requests.
One downside of using such an option for limiting of file uploads is
that it restricts me from providing meaningful error messages to the
user within my application.
Another downside is that the limit would then be static across my
application, preventing me from setting different limits depending on
what the user is doing.
- Jim
_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/