title: File download from FTP to php://output doesn't work
body: <p>I have made a web site with PHP and I have to download a file from FTP server.</p>
  
  <p>I don't want to save temporarily the file on the web server, so I save it in the PHP buffer. But when I download it, the buffer apparently is empty because the filename matches but the file is empty.</p>
  
  <p>Here's my code</p>
  
  <pre><code>ob_start();
  ftp_chdir($conn_id, $_REQUEST["path"]);
  ftp_get($conn_id, "php://output", $_REQUEST["remoteFile"], FTP_BINARY);
  $data = ob_get_contents();
  header('Content-Description: File Transfer');
  header('Content-Type: application/octet-stream');
  header('Content-Disposition: attachment; filename='. $_REQUEST["remoteFile"]);
  header('Expires: 0');
  header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
  header('Pragma: public');
  header('Content-Length: ' . strlen($data));
  echo $data;
  ob_end_clean();
  exit;
  </code></pre>
  
  <p>For example, when I try to download a txt file, previously rightly uploaded, the filename is ok but content is empty.</p>