Hi. All that you say is totally clear to me, but I tried to suit the customer's needs. And, yes, I finished my deals on just saving the images serverside and sending links to files over e-mail. Thanks for that.
Another question that bothers me is the following. ------------------------------------------------------------- for (k, v) in request.FILES.items(): file_data = open('%s/%s' % (dir, filename), 'wb') file_data.write(v.read()) file_data.close() ------------------------------------------------------------- That's not all the loop but that's enough to understand that I write uploaded files to another location to give a link in e-mail. I'm not really sure if it's correct - the files after upload are saved to temp directory or RAM, but I actually read them again "v.read()" to save to another loaction. Is that ok? Is there other way to save uploaded files without reading them again? Thanks. On Mar 18, 8:19 pm, Jirka Vejrazka <jirka.vejra...@gmail.com> wrote: > > 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 > > thefilesas an attachment - I got stuck. > > Smallfilesare read nicely. But when someone "clever" fills out all > > the formfiles(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. > > Hi, > > emailis not really suitable for sendinglargeamounts of data. The > fact that people use it that way is a bit sad, but you should not > really follow their example. > > So, you're trying to send up to 200 MB viaemail. That's in fact > some 270 MB, because binary data is base64 encoded in emails, > typically (not always, but often). That is the reason for the memory > problem. > > As Paulo pointed out, created a unique, temporary URL for > downloading those images and send just the link to that URL. > > HTH > > Jirka -- 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.