title: How to force download to a client.. is printing on the browser
body: <p>I'm trying to create something like a proxy(in PYTHON) to download and I'm getting a error. I want to force the user to download a file but instead is printing(the binary code) on the screen. Here is my code:
  What I'm doing is... downloading a file from another server and at the same time trying to send this file to a client.
  So is something like this: REMOTE_SERVER -> MY_SERVER -> CLIENT without having to save the file in my server. Does anyone could help what I'm doing wrong?</p>
  
  <pre><code>myfile = session.get(r.headers['location'], stream = True)
  print "Content-Type: application/zip\r\n"
  print "Prama: no-cache\r\n"
  print "Expires: 0\r\n"
  print "Cache-Control: must-revalidate, post-check=0, pre-check=0\r\n"
  print "Content-Type: application/octet-stream\r\n"
  print "Content-Type: application/download\r\n"
  print "Content-Disposition: attachment; filename=ternos.205.zip\r\n"
  print "Content-Transfer-Encoding: binary\r\n"
  print "Content-Length: 144303765\r\n"
  
  #print "Accept-Ranges: bytes\r\n"
  print ("\r\n\r\n")
  #with open('suits.zip', 'wb') as f:
  for chunk in myfile.iter_content(chunk_size=1024):
      if chunk:
          sys.stdout.write(chunk)
          sys.stdout.flush()
  </code></pre>
  
  <p>Seems that is nothing with the headers coz I've tried millions of different headers.. force-download, etc... but nothing happens..</p>