next time consider recommending pillow instead of PIL
https://github.com/python-imaging/Pillow
https://pypi.python.org/pypi/Pillow/2.0.0
On Tue, Mar 26, 2013 at 4:30 AM, Nikolas Stevenson-Molnar <
nik.mol...@consbio.org> wrote:
> I think you can get at a file's size with the 'size' attribute
I think you can get at a file's size with the 'size' attribute (in
bytes). Conceivably you could stick it inside a "clean" method for your
form and do it that way.
class MyForm(forms.Form):
...
def clean_image(self):
image = self.cleaned_data['image']
if image.size >
It's easy to do it by file size in your server config. For example, in
nginx or Apache. You shouldn't have to set it in Django, and I don't
believe Django provides any ability to cap it.
https://docs.djangoproject.com/en/dev/topics/http/file-uploads/
--
You received this message because you are
3 matches
Mail list logo