diff --git a/docs/topics/http/file-uploads.txt b/docs/topics/http/file-uploads.txt index 24ff0eb205..bcf8b30409 100644 --- a/docs/topics/http/file-uploads.txt +++ b/docs/topics/http/file-uploads.txt @@ -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.