title: How to force headers to be sent?
body: <p>I have built a progressive file download (download begins while file is still being generated), but some file formats don't support this. To solve this I simply wait until the file is generated and then send it whole.</p>
  
  <p>The problem with this workaround is, that the download dialog pops up when sending starts after the file was generated. This is especially annoying when file generation takes a couple minutes. I suspect that the headers are not sent until actual output starts.</p>
  
  <p>I've tried doing <code>ob_flush(); flush();</code> right before waiting for generation to finish to no avail. Apparently it refuses to send headers when there is no buffered content.</p>
  
  <p>So, how do I force the HTTP-headers to be sent to the client?</p>