Posted in Javascript onMarch 19, 2013
if (context.Request.UserAgent.ToLower().IndexOf("msie", System.StringComparison.Ordinal) > -1)//IE浏览器 { context.Response.AddHeader("content-disposition", "filename=" + HttpUtility.UrlEncode(fileName)); } if (context.Request.UserAgent.ToLower().IndexOf("firefox", System.StringComparison.Ordinal) > -1)//firefox浏览器 { context.Response.AddHeader("content-disposition", "attachment;filename=\"" + fileName + "\""); } else//其他浏览器 { context.Response.AddHeader("content-disposition", "attachment;filename=" + fileName); } context.Response.ContentType = "application/x-xls";
下载文件个别浏览器文件名乱码解决办法
声明:登载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。
Reply on: @reply_date@
@reply_contents@