title: why is readfile necessary after a flush
body: <p>So i'm using a solution i found on internet to send file, and it's actually working !
  But i don't really understand why :(</p>
  
  <p>In my solution i'm generating a CSV (test;test;test;test;test).</p>
  
  <p>So i tell my header it's a csv file and that it should be an attachment as well :</p>
  
  <pre><code>&lt;?php
  $nom = time().'.csv';
  header('Content-type: text/csv');
  header('Content-disposition: attachment;filename='.$nom);
  ?&gt;
  </code></pre>
  
  <p>I understand this, this is simple, but when it comes to :</p>
  
  <pre><code>flush();
  readfile($nom);
  </code></pre>
  
  <p>i understand that flush(); is devlivering the buffer to the client right ?
  But why is readfile(); necessary ?
  I mean, if content is sent, why would i read the file again ?</p>