I have a form in my django app where users can upload files.
How can i set a limit to the uploaded file size so that if a user uploads a file larger than my limit the form won't be valid and it will throw an error?
views:
448answers:
2
+2
A:
Take a look at this snippet: http://www.djangosnippets.org/snippets/1303/
ign
2010-03-18 18:35:29
+2
A:
I believe that django form receives file only after it was uploaded completely.That's why if somebody uploads 2Gb file, you're much better off with web-server checking for size on-the-fly.
See this mail thread for more info.
Dmitry Shevchenko
2010-03-18 19:33:29
I agree with you on this but in my case i need the limit to be in Django.
daniels
2010-03-30 17:46:03