title: HTTP Download very Big File
body: <p>I'm working at a web application in Python/Twisted.</p>
  
  <p>I want the user to be able to download a very big file (> 100 Mb). I don't want to load all the file in memory (of the server), of course.</p>
  
  <p>server side I have this idea:</p>
  
  <pre><code>...
  request.setHeader('Content-Type', 'text/plain')
  fp = open(fileName, 'rb')
  try:
      r = None
      while r != '':
          r = fp.read(1024)
          request.write(r)
  finally:
      fp.close()
      request.finish()
  </code></pre>
  
  <p>I expected this to work, but I have problems:
  I'm testing with FF... It seems the browser make me wait until the file is completed downloaded, and then I have the open/save dialog box.</p>
  
  <p>I expected the dialog box immediately, and then the progress bar in action...</p>
  
  <p>Maybe I have to add something in the Http header... Something like the size of the file?</p>