title: Download file size is unknown although file size is present in header
body: <p>I am doing the follwoing on a web page: A click on an element sends a set of data (attached to the element) to my server which will then generate a custom zip-file:</p>
  
  <pre><code>$.post(urlprefix + 'makeZip.php', params, function(data){
      window.location = urlprefix + 'getZip.php?file=' + data; //get file
  }).error(handleAJAXError);
  </code></pre>
  
  <p><code>makeZip.php</code> works just fine and returns the name of the (temporary) zip file that the client should then download. As I want to keep my server clean I route the file through another script called <code>getZip.php</code> which does the following:</p>
  
  <pre><code>/* RETURN REQUESTED FILE AND DELETE FROM SERVER*/
  $filename = $_GET['file'];
  /* TRANSFER FILE CONTENTS */
  header('Content-type: application/zip');
  header('Content-Disposition: attachment; filename="customDownload.zip"');
  header('Content-Length: '.filesize($filename));
  readfile($filename);
  /* REMOVE FILE FROM SERVER */
  unlink($filename);
  </code></pre>
  
  <p>All browsers will download the file successfully, yet I am facing one problem: the files can get rather big (up to 200MB) so I thought it would be nice to have an estimate of how long the download's going to take. That's why I am sending the <code>Content-Length</code> header (the specified filesize is correct). Yet, all browsers I tested this is are telling me the filesize is unknown (which might lead to the user skipping the download).</p>
  
  <p>Is this some kind of problem with my header information? Is it a client-side problem? Should I use another approach to getting the client to download the file?</p>