On 10 Jul 2009, at 16:36, A Murka wrote:

What's the recommended way to validate file upload's size and type
(either filename or MIME) before downloading it into the temp
directory? I don't want the user to be able to upload a 200 MB file in
its entirety before having the controller reject it for being too big.

You're looking for http://search.cpan.org/~flora/Catalyst- Runtime-5.80007/lib/Catalyst.pm#ON-DEMAND_PARSER

Set that, and the body of the request will only be read when you access it. So you can check the content-length (and other headers) and reject the request before the rest of the content arrives...

Cheers
t0m



_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to