//Response給用戶端下載
Response.Clear();
Response.ContentEncoding = System.Text.Encoding.GetEncoding("UTF-8"); //解決中文亂碼
Response.AddHeader("content-disposition", "attachment; filename=" + Server.UrlPathEncode("中文中文.pdf"));//強制下載
Response.ContentType = "application/octet-stream";
Response.BinaryWrite(file);
沒有留言:
張貼留言