Skip to content

Instantly share code, notes, and snippets.

Last active December 21, 2015 18:39
What would you like to do?
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