我使用CarlosAG-Dll,它为我创建一个XML-Excel文件(在内存流中)。
Response.ContentType = "application/vnd.ms-excel";
Response.AppendHeader("content-disposition", "myfile.xml");
memory.WriteTo(Response.OutputStream);
我的问题在于,客户端会得到一个 myfile.xls(IE)或 myfile.xml.xls(FF),因此会从 Excel 获取一个烦人的安全警告。
我尝试过使用 application/vnd.openxmlformats-officedocument.spreadsheetml.sheet(xlsx),但它甚至无法打开。
因此,我需要删除 .xml 并将其发送为 vnd.ms-excel(如何?),或者选择另一种 MIME 类型(但是哪种呢?)。
编辑:我在这里找到了一个错误描述。
我想知道这个问题是否仍然存在,以及为什么?