Answer the question
In order to leave comments, you need to log in
How to limit file upload size in Django?
Hello.
Situation: The
user uploads an avatar through the form on the site, which is stored in the imageFiled field. In my personal account, I already correctly display this picture through easy-thumbnails. However, nothing prevents the client from uploading a giant picture and giving me a memory. Therefore:
1) Either you need to limit the size of the picture that the client can download.
2) Either accept the file, compress it and only then save it. (but again, nothing prevents us from filling up the memory while we take it).
In general, how to be and how best to solve this situation?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question