title: I/O operation on closed file only with large file (>3M)
body: <p>I use django and save uploaded file with the same code:</p>
  
  <pre><code>destination = open(directory + newfilename, 'wb+')
  for chunk in docfile.chunks():
      destination.write(chunk)
      destination.close()
  </code></pre>
  
  <p>But when I upload large file (~3M and more) I get this error:</p>
  
  <pre><code>ValueError: I/O operation on closed file
  </code></pre>
  
  <p>On <code>destination.write(chunk)</code> line.
  How can I fix this?</p>