[英]Download a torrent file through PHP
我正在創建一個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是無效的bencoding。 有什么問題或我必須做什么?
我認為這可能行得通...無法測試種子鏈接,因為在我的國家/地區:-(
$file = "abc.torrent"
$content = file_get_contents('http://www.example.com/sdfsdfs.torrent')
move_uploaded_file($content, '$file');
僅PHP
不能下載torrent,您可能需要安裝Transmission並使用Transmission api來使用PHP
管理和下載torrent。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.