IE 11 downloaded the file when found garbled.
Online Check the information, understand, mainly user-agent changed, is no longer msie, face is rv:11.0 so, as long as the service side to determine that is IE 11, processing with the same as MSIE.
GO:
Funcsetdownloadfilename(whttp. Responsewriter,fileName,agentstring) {
Ifstrings. Contains(agent,"MSIE"){
FileName=url. Queryescape(fileName)
FileName=strings. Replace(fileName,"+","%20" , -1)
}
Ifstrings. Contains(agent,"rv:")&& strings. Contains(agent,"Gecko"){
FileName=url. Queryescape(fileName)
FileName=strings. Replace(fileName,"+","%20", -1)
}
W. Header(). Set("content-disposition","attachment;filename=\" " +fileName+"\" ")
}
Php:
$ua = Isset ($_server ["http_user_agent"])? $_server ["Http_user_agent"]: '; if (Preg_match ("/msie/", $ua)) {$file _name = Rawurlencode ($file _name); Header (' content-disposition:attachment; filename= '. $file _name. '"' );} else if (Preg_match ("/firefox/", $ua)) {header (' content-disposition:attachment; filename*= ' utf8\ ' \ '. $fil E_name. '"' );} ElseIf (Stripos ($ua, ' rv: ') > 0 && stripos ($ua, ' Gecko ') > 0) {$file _name = Rawurlencode ($f Ile_name); header (' content-disposition:attachment; filename= '. $file _name. '"' );} else {header (' content-disposition:attachment; filename= '. $file _name. '"' );}
The above describes the IE 11 download file Chinese garbled solution go/php, including the aspects of the content, I hope that the PHP tutorial interested friends helpful.