正確下載中文檔名 正確下載中文檔名
  .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

我要留言