Phpheader jumps to ie. The movie site provides bt download for the movie. because the Polaroid player is used, a hash file of the movie will be uploaded at the same time when uploading the movie. This hash file is used to dynamically download the bt file from the animation production Station upon the first request. because of the use of the Polaroid player, a hash file of the movie will be uploaded simultaneously during the upload of the movie. This hash file is used to dynamically generate the corresponding bt seed for saving (specifying the path) during the first request and provide download. When you click to download the bt seed, first check whether the corresponding bt seed file exists in the corresponding directory. If yes, download it directly. otherwise, download it again.
The download of Bt seeds directly uses the header redirection method in the file. The PHP file is gbk encoded.
Later, we found that chrome, firefox, and ie6 both work normally, but in ie8, we may find that files cannot be found. This made me very depressed. ie6 can be used, and the result is still problematic in ie8.
[Php]
// Point to the torrent file for download
// $ Torrent_file_url = "torrent/tyvod1/Science Fiction/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 comparison and test, it is found that ie8 cannot be downloaded if the path contains Chinese characters. The PHP file itself is GBK encoded, so before the jump, we first convert the gbk encoded string to utf8 encoding.
[Php]
// Point to the torrent file for download
// $ Torrent_file_url = "torrent/tyvod1/Science Fiction/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 ();
Now, there is no problem in chrome, firefox, ie8, and ie9, but it cannot be downloaded in ie6. Chinese characters are garbled. The reason is that ie6's support for UTF-8 is not perfect. Nima ie is really difficult to serve, whether it is GBK encoding or UTF-8 encoding, chrome and firefox can be correctly resolved, ie's own brother has such a problem.
I didn't find a good solution. I had to do it for ie6...
[Php]
// Point to the torrent file for download
// $ Torrent_file_url = "torrent/tyvod1/Science Fiction/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
Bytes. This hash file is used to dynamically generate the first request...