解决MVC模式文件下载附件中文名称乱码

 

解决如下:

进行url编码:Server.UrlPathEncode(file.AttachmentName)

 

 return File(file.TempWorkPath, CommonTools.GetContentType(Path.GetExtension(file.TempWorkPath).Replace(".", "")), Server.UrlPathEncode(file.AttachmentName));

  

posted @ 2017-04-14 11:51  【可乐不加冰】  阅读(295)  评论(0编辑  收藏  举报