Re: File Field max size and admin interface

2009-09-15 Thread David De La Harpe Golden
Peter Bengtsson wrote: > Sadly this means that if a user tries to upload a 11Mb file you won't > be able to confront them with a user-friendly "error" message. > It's pretty straightforward to subclass django.forms.fields.FileField to apply a size limit in clean(), or perhaps just do the check

Re: File Field max size and admin interface

2009-09-13 Thread Peter Bengtsson
One way of doing it, and to be honest the only one I know, is to set a limit in the fronting web server. In Nginx for example you add: client_max_body_size 10M; Sadly this means that if a user tries to upload a 11Mb file you won't be able to confront them with a user-friendly "error" message.

File Field max size and admin interface

2009-09-13 Thread drakkan
Hi, I'm using the admin interface with some filefield, I tested with a big file (200 MB) and it was successfully uploaded, this is ok but I would like a way to limiting the uploaded size for example to a maximun of 10 MB, any hints? thanks drakkan --~--~-~--~~~---~--~