Hi there

In an app we are coding, we are allowing users to upload image files -
in django's admin nonetheless.

we want to set a max file size  (e.g. 400 kb) so we can keep our
servers happy (those file will be processed by PIL). The idea is to
avoid an uneducated user uploading his 10 mb digital camera files and
giving the server a hard time.

My question is, where would be the best place to check for the file
size? Looking at this some what   related thread, it seems that
_pre_save() should do it:
http://groups.google.com/group/django-users/browse_thread/thread/85715b106146ebc0/c852373a4d774984?q=filefield++&rnum=5#c852373a4d774984

if I do it in _pre_save() will this only get called AFTER the file has
been uploaded? if so, is there a way to check for this BEFORE the file
is uploaded?

are more people interested / needing this? would it make any sense to
add an optional maxsize parameter to the FileField object?

thanks lot,
arthur

Reply via email to