title: Content-Length header always zero
body: <p>I set a header in the following way:</p>
  
  <pre><code>header('Content-Length: ' . filesize($strPath));
  </code></pre>
  
  <p>On my PC with ZendServer it works fine and I can download a file with the correct file size. On the production server, a Solaris with Apache and compiled PHP, I get a file with the file size equal to zero, so an empty file.</p>
  
  <p>Is there a config parameter? Something that can prevent to set 'Content-Length: 1222'?</p>
  
  <p>Thanks.</p>
  
  <p>The code:</p>
  
  <pre><code>&lt;?php
  error_reporting(E_ALL);
  ini_set('display_errors', '1');
  
  require 'includes/prepend.inc.php';
  require __ADMIN_DIR__.'/AdminInfo.php';
  $intFile = QApplication::QueryString('fileID');
  if($intFile == '') die('Error: missing ID');
  $objFile = File::Load($intFile);
  $blnRight = false;
  $objAdminInfo = new AdminInfo();
  if($objAdminInfo-&gt;isAdmin()) {
      $blnRight = true;
  }
  else {
      $objSecMan = new SecurityManager(
          'file:'.$objFile-&gt;FileID, 
          $objAdminInfo-&gt;getUserID()
      );
      $blnRight = $objSecMan-&gt;processResource('view');
  }
  
  // if the user can modify and or publish, can even view the file
  if(!$blnRight) {
      $blnRight = $objSecMan-&gt;processResource('modify');
  
      if(!$blnRight) {
          $blnRight = $objSecMan-&gt;processResource('publish');
      }       
  }
  
  //$strPath = __UPLOADS__.DIRECTORY_SEPARATOR.$objFile-&gt;FileID;
  $strPath = 'subdept.csv';
  
  if (file_exists($strPath) &amp;&amp; $blnRight) {
      header('Content-Description: File Transfer');
      header('Content-Type: application/octet-stream');
      header('Content-Disposition: attachment; filename='.$strPath);//$objFile-&gt;Filename);
      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($strPath));
      ob_clean();
      flush();
      readfile($strPath);
      exit;
  }
  else {
      die('Restricted access');
  }   
  ?&gt;
  </code></pre>
  
  <p>When I comment the code before $strPath  it works, so it must be something in the bloody framework. I would like to throw the whole CMS away.</p>