Movie Station offers the movie BT download, due to the use of the Polaroid player, upload a movie when uploading a movie hash file. Using this hash file, the first time the request is dynamically generated, the corresponding BT seed is saved (specified path) and provided for download. When the user clicks to download the BT seed, first to the corresponding directory to detect the corresponding BT seed file exists, if present, then directly provide the download, or Mr. Cheng, and then download.
Download the BT seed directly in the file using the header jump method. The PHP file itself is GBK encoded.
Later found that in Chrome and Firefox and IE6 in the normal work, but in the IE8 will appear to find the case of no files. This makes me very depressed, IE6 can do, the result IE8 still have problem.
[PHP]
Point to Torrent file, provide download
$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon torrent"
$redirect _url = "http://vod.cqjtu.edu.cn/". $torrent _file_url;
Header ("http/1.1 303 See other");
Header ("Location:". $redirect _url);
Exit ();
After the comparison test, it is found that if there is Chinese in the path, IE8 will not be able to download. The PHP file itself is GBK encoded, so we first convert the GBK encoded string to UTF8 encoding before jumping.
[PHP]
Point to Torrent file, provide download
$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon torrent"
$redirect _url = "http://vod.cqjtu.edu.cn/". $torrent _file_url;
Header ("http/1.1 303 See other");
Header ("Location:". Iconv ("GBK", "Utf-8", $redirect _url));
Exit ();
This is no problem with Chrome and Firefox and IE8 and IE9, but it's not possible to download them in IE6. Chinese garbled. Check the information after said because IE6 to UTF-8 support is not perfect. GBK IE is really difficult to serve, whether it is a code or UTF-8 code, chrome and Firefox can correctly parse, ie home Brother actually out of such a problem.
Did not find a good way, had to specifically for the IE6 do a bit ...
[PHP]
Point to Torrent file, provide download
$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon torrent"
$redirect _url = "http://vod.cqjtu.edu.cn/". $torrent _file_url;
Header ("http/1.1 303 See other");
if (Strpos ($_server[' http_user_agent '), ' MSIE 6.0 ') ===false) {//non-IE6
Header ("Location:". Iconv ("GBK", "Utf-8", $redirect _url));
}else{//ie6
Header ("Location:". $redirect _url);
}
Exit ();
Author: jdluojing
http://www.bkjia.com/PHPjc/478141.html www.bkjia.com true http://www.bkjia.com/PHPjc/478141.html techarticle Movie Station offers the movie BT download, due to the use of the Polaroid player, upload a movie when uploading a movie hash file. Using this hash file, the first time you request a dynamic ...