On Mon, 2006-07-10 at 10:42 +0000, [EMAIL PROTECTED] wrote:
> Hi.
> 
> Is there a way to limit upload file size *before* the upload is
> accepted?
> 
> Say I want to give people the option of uploading movie files, but I
> want to limit them to 4MB per movie. If I understand the upload
> behaviour of Django correctly, the file is first accepted into main
> memory (*) , after which I have access to metadata.
> This would mean that somebody could easily OOM my Apache just by
> uploading a huuuuuge file. Also, in a hosted environment, this is
> unnecessary traffic which I'd have to pay for.

Without answering your question directly, let me just point out that
even if such a limit existed in Django, it still wouldn't help your
Apache process, since it is already accepting the data.

Fortunately, you *can* control this at the Apache level. Look at the
LimitRequestBody directive.

Regards,
Malcolm



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to