Hello everyone. I need some help or advice.

I've got a form with 20 ImageFields - such a form for sending photos
to the site admin as a request for a new user. Well, Django certainly
handles and uploads the, that's OK. But when it comes to sending all
the files as an attachment - I got stuck.

Here's a simple example of how I tried to do that:
------------------------------------------------
from django.core.mail import EmailMessage

email = EmailMessage()
for (k, v) in request.FILES.items():
    email.attach(v.name, v.read())
------------------------------------------------

Small files are read nicely. But when someone "clever" fills out all
the form files (all the twenty) with images each one at least 10 Mb -
Django consumes so much memory... so I'm not in knowledge to handle
that.

Please, guide me how to handle big files from a form and send them
without memory leaks. Thanks ahead.

-- 
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