我正在创建一个torrent平台(没有跟踪器),从服务器下载torrent时遇到了一些问题。
这是我的脚本部分:
$fn = dirname(__FILE__) . "/torrents/$id.torrent";
header("Cache-Control: public");
header("Content-Description: File Transfer");
header("Content-Disposition: attachment; filename=$tname.torrent");
header("Content-Length: ".filesize($fn));
header("Content-Type: application/force-download");
header("Content-Transfer-Encoding: binary");
readfile($fn);
当我通过这个文件(在我的例子中是download.php)下载torrent时,torrent不是有效的编码。有什么问题,或者我必须做什么?
发布于 2015-10-04 04:11:43
我想这可能行得通…我无法测试,因为torrent链接在我的国家是被禁止的:-(
$file = "abc.torrent"
$content = file_get_contents('http://www.example.com/sdfsdfs.torrent')
move_uploaded_file($content, '$file');发布于 2015-10-04 04:30:47
单独使用PHP 无法下载torrents,您可能需要安装transmission并使用transmission api通过PHP管理和下载torrents。
https://stackoverflow.com/questions/32926874
复制相似问题