Fixed #9075: Added a call to close() in the example file upload handler. Thanks to Brendan (bmsleight) for the suggestion.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@9027 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
ea0fe604d8
commit
c9f0dd1ed6
|
@ -94,6 +94,7 @@ Putting it all together, here's a common way you might handle an uploaded file::
|
|||
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.
|
||||
|
|
Loading…
Reference in New Issue