title: PHP Force Download Causing 0 Byte Files
body: <p>I'm trying to force download files from my web server using PHP.
  I'm not a pro in PHP but I just can't seem to get around the problem of files downloading in 0 bytes in size.</p>
  
  <p>CODE:</p>
  
  <pre><code>$filename = "FILENAME...";
  
  header("Content-type: $type");
  header("Content-Disposition: attachment;filename=$filename");
  header("Content-Transfer-Encoding: binary");
  header('Pragma: no-cache');
  header('Expires: 0');
  set_time_limit(0);
  readfile($file);
  </code></pre>
  
  <p>Can anybody help?
  Thanks.</p>