Skip to content

Instantly share code, notes, and snippets.

@jzwang-dev
Created January 21, 2021 16:06
Show Gist options
  • Save jzwang-dev/4b7fe7aaa2d6ea6eebb6ceff89ede8b8 to your computer and use it in GitHub Desktop.
Save jzwang-dev/4b7fe7aaa2d6ea6eebb6ceff89ede8b8 to your computer and use it in GitHub Desktop.
// Inline形式下載檔案
public ActionResult DownloadTestFile()
{
var fileBytes = Encoding.UTF8.GetBytes("Hello, World!");
Response.AppendHeader("Content-Disposition",
JZLib.HeaderUtil.GetUnicodeContentDisposition("測試中文.txt", true));
return File(fileBytes, "text/plain");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment