Author: russellm
Date: 2008-09-14 05:32:04 -0500 (Sun, 14 Sep 2008)
New Revision: 9027
Modified:
django/trunk/docs/topics/http/file-uploads.txt
Log:
Fixed #9075: Added a call to close() in the example file upload handler. Thanks
to Brendan (bmsleight) for the suggestion.
Modified: django/trunk/docs/topics/http/file-uploads.txt
===================================================================
--- django/trunk/docs/topics/http/file-uploads.txt 2008-09-14 09:39:04 UTC
(rev 9026)
+++ django/trunk/docs/topics/http/file-uploads.txt 2008-09-14 10:32:04 UTC
(rev 9027)
@@ -94,6 +94,7 @@
destination = open('some/file/name.txt', 'wb+')
for chunk in f.chunks():
destination.write(chunk)
+ destination.close()
Looping over ``UploadedFile.chunks()`` instead of using ``read()`` ensures that
large files don't overwhelm your system's memory.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---