0
文件名:abc.aspx使用的(「內容處置」,「內聯;文件名=」 +文件名+ 「」)不顯示文件名
我的代碼:
string Path = @"E:\documents\Data20160129110355.xls";
HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
HttpContext.Current.Response.AppendHeader("Content-Disposition", "inline; filename=Data20160129110355.xls");
HttpContext.Current.Response.TransmitFile(Path);
HttpContext.Current.Response.Flush();
HttpContext.Current.Response.Close();
在點擊「打開」將成功打開文件,但文件的標題未顯示「Data20160129110355.xls」。它顯示了abc.aspx。
如何解決此問題請回復。
在提供的鏈接中提供內容的要點作爲答案的一部分是一種好的做法。 – 4J41