PHP Header Jump IE problem
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.
Point to Torrent file, offer download//$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon Thor 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.
<textarea readonly="" name="code" class="php">//point to torrent file, provide download//$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon Thor 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 ();</textarea>
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 ...
Point to Torrent file, offer download//$torrent _file_url = "torrent/tyvod1/sci-fi film/Raytheon Thor 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-Ie6header ("Location:". Iconv ("GBK", "Utf-8", $ Redirect_url));} Else{//ie6header ("Location:". $redirect _url);} Exit ();
I don't know if any of you have ever encountered this problem, or have a better solution.
Incidentally, the Polaroid, do not know who has used it. What does this thing say, there are good and bad. Good place is the use of peer effect or good, bad place is the use of inconvenient, the official information is too small, only provides a basic example. And that. hash file, which generates torrent directly. The most pit Daddy is tracker actually in set for its own tracker, and can't change. This is useless if the intranet user uses this. But after unpacking the official installer, you can still modify the tracker. Originally is the intranet to peer, oneself build a tracker than use it to provide the outside network tracker to be safe, stable much.
If there is a better free LAN-to-peer solution, please tell my brother a sound).