.NET ez 2011-11-29
由於檔名部分只支援BIG5,所以要將HeaderEncoding改為BIG5即可!
protected void Page_Load(object sender, EventArgs e) { Response.ContentType = "application/octet-stream"; Response.HeaderEncoding = System.Text.Encoding.GetEncoding("BIG5"); Response.AddHeader("content-disposition","attachment;filename=中文.doc"); Response.WriteFile(Server.MapPath("~/中文.doc")); Response.End(); }
標籤: .NET
本文章網址:
https://www.ez2o.com/Blog/Post/csharp-Download-BIG5-File-Name
https://www.ez2o.com/Blog/Post/38
https://www.ez2o.com/Blog/Post/csharp-Download-BIG5-File-Name
https://www.ez2o.com/Blog/Post/38