I have a form for uploading images. When uploaded I check for a
maximum size, see snippet below. If it's too big I return the same
form but without the uploaded (big) image. Unfortunately the big image
is part of the returned form (I can tell since I display the image for
a form). Is there a way to reset the file? I've tried 'request.FILES =
None' but I'm not allowed to set request.FILES.

===snippet
newImage = imageForm.save(commit=False)
#image too big?
if (newImage.get_image_width() <= maxImgWidth and
newImage.get_image_height() <= maxImgHeight)
    newHscImage.save()
else:
    #How to discard the image?
    pass
===

2B

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

Reply via email to