title: Response ZIP file by Django
body: <p>I try to download img from url, add it to zip archive and then response this archive by Django HttpResponse.</p>
  
  <pre><code>import os
  import requests
  import zipfile
  from django.http import HttpResponse
  
  url = 'http://some.link/img.jpg' 
  file = requests.get(url)
  data = file.content
  rf = open('tmp/pic1.jpg', 'wb')
  rf.write(data)
  rf.close()
  zipf = zipfile.ZipFile('tmp/album.zip', 'w') # This file is ok
  filename = os.path.basename(os.path.normpath('tmp/pic1.jpg'))
  zipf.write('tmp/pic1.jpg', filename)
  zipf.close()
  resp = HttpResponse(open('tmp/album.zip', 'rb'))
  resp['Content-Disposition'] = 'attachment; filename=album.zip'
  resp['Content-Type'] = 'application/zip'
  return resp # Got corrupted zip file
  </code></pre>
  
  <p>When I save file to tmp folder - it's ok, I can extract it.
  But when I response this file I get 'Error 1/2/21' on MacOS or Unexpected EOF if I try to open in Atom editor (just for test).
  I also used StringIO instead of saving zip file, but it doesn't influence the result.</p>