This is a creation in Article, where the information may have evolved or changed.
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:
func setdownloadfilename ( w http. Responsewriter filename agent string ) {
ifstrings. Contains(agent,"MSIE"){
fileName=url. Queryescape(fileName)
fileName=strings. Replace(fileName,"+","%20" , -1)
}
     Span style= "font-weight:600; Color: #64b1ff ">if strings 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"]: "; <span style=" White-space:pre "></span>if (Preg_match ("/MSIE/", $ua)) {& Lt;span style= "White-space:pre" ></span> $file _name = Rawurlencode ($file _name); <span style= "White-space: Pre "></span>header (' content-disposition:attachment; filename=" '. $file _name. '"' );} else if (Preg_match ("/firefox/", $ua)) {<span style= "White-space:pre" ></span>header (' Content-disposition:attachment; Filename*= "Utf8\". $file _name. '"' );} ElseIf (Stripos ($ua, ' rv: ') > 0 && stripos ($ua, ' Gecko ') > 0) {<span style= "White-space:pre" >< ;/span> $file _name = Rawurlencode ($file _name); <span style= "White-space:pre" ></span>header (' Content-disposition:attachment; Filename= "'. $file _name. '"' );} else {<span style= "White-space:pre" ></span>header (' content-disposition:attachment; Filename= '. $file _ Name. '"' );}