title: php, file download
body: <p>I am using the simple file downloading script:</p>
  
  <pre><code>if (file_exists($file)) {
      header('Content-Description: File Transfer');
      header('Content-Type: application/octet-stream');
      header('Content-Disposition: attachment; filename='.basename($file));
      header('Content-Transfer-Encoding: binary');
      header('Expires: 0');
      header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
      header('Pragma: public');
      header('Content-Length: ' . filesize($file));
      ob_clean();
      flush();
      readfile($file);
      exit;
  }
  </code></pre>
  
  <p>It is working on my localserver upto 200mb. </p>
  
  <p>When i try this code in my website it downloads 173KB instead of 200MB file. </p>
  
  <p>I checked everything, wrote some custom code (using ob functions and fread instead of readfile) but can't download big files.</p>
  
  <p>Thank you for your answers.</p>
  
  <ul>
  <li>I am using Apache 2.2, PHP 5.3</li>
  <li>All PHP settings to deal with big files are ok. (execution times, memory limits, ...</li>
  </ul>