Created
January 21, 2021 16:04
-
-
Save jzwang-dev/b76b634b3bc0977e5b0428d5e5375ccb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 下載檔案 | |
protected void btnDownload_Click(object sender, EventArgs e) | |
{ | |
var fileBytes = Encoding.UTF8.GetBytes("Hello, World!"); | |
Response.ClearContent(); | |
Response.ClearHeaders(); | |
Response.ContentType = "text/plain"; | |
Response.AppendHeader("Content-Disposition", | |
JZLib.HeaderUtil.GetUnicodeContentDisposition("測試中文.txt", false)); | |
Response.BinaryWrite(fileBytes); | |
Response.End(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment