asp.netからIEでdocxファイルを開きたい。IISには、mimeタイプが正しくマップされています。PDFを正常に開くことはできますが、docxは常にcontent-disposition='attachment'のようにダウンロードするように求めます。行うべき設定はありますか?
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.Cookies.Clear();
Response.Cache.SetCacheability(HttpCacheability.Private);
Response.CacheControl = "private";
Response.Charset = System.Text.UTF8Encoding.UTF8.WebName;
Response.ContentEncoding = System.Text.UTF8Encoding.UTF8;
Response.AppendHeader("Content-Length", buffer.Length.ToString());
Response.AppendHeader("Pragma", "cache");
Response.AppendHeader("Expires", "60");
Response.ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
Response.AppendHeader("Content-Disposition",
"inline; " +
"filename=\"" + "test.docx" + "\"; " +
"size=" + buffer.Length.ToString() + "; " +
"creation-date=" + DateTime.Now.ToString("R") + "; " +
"modification-date=" + DateTime.Now.ToString("R") + "; " +
"read-date=" + DateTime.Now.ToString("R"));
Response.BinaryWrite(buffer);
Response.Flush();
HttpContext.Current.ApplicationInstance.CompleteRequest();
Response.End();