Last active
December 21, 2015 18:39
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
//指定ContentType | |
context.Response.ContentType = _contentType; | |
//檔案Response出去 註:這邊會將檔案整個Response出去但是並不會顯示路徑!! | |
context.Response.WriteFile(ConfigurationManager.AppSettings["files_folder_PhysicalPath"] + _file); | |
string _fileName = HttpUtility.UrlPathEncode( Path.GetFileName(_file)); | |
string strContentDisposition = String.Format("{0}; filename=\"{1}\"", "inline", _fileName); | |
context.Response.AddHeader("Content-Disposition", strContentDisposition); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment