title: SlimPHP Application not downloading File
body: <p>I am trying to dowload a file using SlimPHP and it doesn't seem to be working for me.</p>
  
  <p>Here is the route I have made:</p>
  
  <pre><code>    $backendApp-&gt;post('/export', function ($request, $response, $args) {
          $emails = $this-&gt;orginization-&gt;exportEmails();
          $exportFile = $this-&gt;file-&gt;writeEmailExport($emails, 'AllEmails.csv');
  
          $fh = fopen($exportFile, "r");
          $stream = new \Slim\Http\Stream($fh);
  
          $response = $response-&gt;withHeader('Content-Type', 'application/octet-stream')
              -&gt;withHeader('Content-Description', 'File Transfer')
              -&gt;withHeader('Content-Disposition', 'attachment; filename="' . basename($exportFile) . '"')
              -&gt;withHeader('Content-Length', filesize($exportFile))
              -&gt;withBody($stream);
  
          return $response;
      });
  </code></pre>
  
  <p>I know for a fact that $exportFile is a valid PHP streaming resource as the contents of the file come back in the response, I just need to trigger the browser file download functionality for the user.</p>
  
  <p>These are the headers that are present on the response:</p>
  
  <pre><code>Cache-Control:no-store, no-cache, must-revalidate, post-check=0, pre-check=0
  Connection:close
  Content-Description:File Transfer
  Content-Disposition:attachment; filename="AllEmails.csv"
  Content-Length:267
  Content-Type:application/octet-stream
  Expires:Thu, 19 Nov 1981 08:52:00 GMT
  Host:localhost:8080
  Pragma:no-cache
  X-Powered-By:PHP/5.6.15
  </code></pre>
  
  <p>Does anything immediately standout that I am doing wrong here? I can see the contents of the file come back in the response tab so I know that I am getting the contents of the file, I just need the user to be prompted to download said file.</p>