title: PHP Content-Length header not working
body: <p>I am trying to use this code to download a .zip file</p>
  
  <pre><code>&lt;?php
      $file = "something.zip";
      $size = filesize($file);
      header('Content-type: application/octet-stream');
      header("Content-length: $size");
      header('Content-Disposition: attachment; filename="downloaded.zip"');
      readfile($file);
  ?&gt;
  </code></pre>
  
  <p>but it does not seem to work, even when I try to set the filesize to a number like <code>header("Content-length: 567247784");</code>. I only get a file that either has no size declared, or a small file size like 28 bytes.</p>
  
  <p>I looked at <a href="https://stackoverflow.com/questions/19931954/header-content-length-not-working">this</a> question, and I think I have the same problem as the poster, but his solution is "there was a server problem". I think I also have a server configuration issue, but his answer does not help me at all. </p>