title: php download file header echo
body: <p>i got code like this</p>
  
  <pre><code>          [... page content]
            header("Content-type: application/x-download");
            header("Content-Length: ".$filesize);
            header("Content-Disposition: attachment; filename=".urlLastSeg($buttons['Torrent file(Torcache)']));
            header("Content-Transfer-Encoding: binary");
            echo $filecontent ; 
  </code></pre>
  
  <p>then browser prompts to save file but the file contains html of the page with binary data attached at the end instead of binary data alone.</p>