title: Download a torrent file through PHP
body: <p>I'm creating a torrent platform (without tracker) and I have some problems while downloading the torrent from the server.</p>
  
  <p>This is my part of the script:</p>
  
  <p><code>$fn = dirname(__FILE__) . "/torrents/$id.torrent";</code><br />
  <code>header("Cache-Control: public");</code><br />
  <code>header("Content-Description: File Transfer");</code><br />
  <code>header("Content-Disposition: attachment; filename=$tname.torrent");</code><br />
  <code>header("Content-Length: ".filesize($fn));</code><br />
  <code>header("Content-Type: application/force-download");</code><br />
  <code>header("Content-Transfer-Encoding: binary");</code><br />
  <code>readfile($fn);</code></p>
  
  <p>When I download the torrent throught this file (download.php in my case), torrent is not valid bencoding.
  What's the problem or what I have to do?</p>