As far as I know you have no way of knowing the size of the file before
the upload except if you use a javascript/flash upload. Otherwise to
determit the size of the file the user will have to upload it and then
the form (along with the file) is sent to your view which will then
handle it.

The allowed upload size should be possible to set in apache but it's
been many years since I used apache and leave that part of the question
for someone else to answer.
On 24 May 12:04, laspal wrote:
> Hi,
>  How to restrict the size of file being uploaded. I am using django
> 1.1 with apache. Can I use apache for this and show some html error
> page if say size is bigger then 100MB.
> I can use LimitRequestBody for restricting the file size in apache,
> My problem is I wanted to show some error page if size is bigger then
> 100MB before the file is actually uploaded.
> 
> Thanks.
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Django users" group.
> To post to this group, send email to django-us...@googlegroups.com.
> To unsubscribe from this group, send email to 
> django-users+unsubscr...@googlegroups.com.
> For more options, visit this group at 
> http://groups.google.com/group/django-users?hl=en.
> 

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to