博客园  :: 首页  :: 联系 :: 管理

解决文件下载时中文名乱码问题

Posted on 2008-12-25 10:21  sunrack  阅读(566)  评论(0)    收藏  举报

 

                Response.Charset = "GB-2312";
                Response.AppendHeader(
"Content-Disposition""attachment; filename=" + HttpUtility.UrlEncode(curResource.ResourceURL));
                Response.ContentEncoding
=System.Text.Encoding.UTF7;
                Response.ContentType 
= "application/octet-stream";
                Response.TransmitFile(Server.MapPath(StudentHomeManager.DownloadPath 
+ "/" + curResource.ResourceURL));
                Response.End();