开发者

How to determine real format of an XLSX Excel file?

开发者 https://www.devze.com 2023-01-13 12:23 出处:网络
I have a well known problem that is described in Extension Warning On Opening Excel Workbook from a Web Site microsoft blog entry. I\'ve added URL rewrite to have URL nicely formatted and my mime type

I have a well known problem that is described in Extension Warning On Opening Excel Workbook from a Web Site microsoft blog entry. I've added URL rewrite to have URL nicely formatted and my mime type matches exactly XLSX recommended file type. However I still get a warning. I suspect tha开发者_开发问答t service that provides me those xlsx files mismatches real file format and extension.

Is there a way to determine real xlsx file format? Something that would say what is the native extension for particular Excel file.

Thanks in advance.


Have you tried changing the mime header from vnd:excel to octet-stream? This will still bring Excel up, albeit not embedded into IE, which vnd:excel does (but I hate vnd:excel anyways because embedding the spreadsheet into the browser screws up the form flow of my web apps).


Did not find an answer for that anyway. However I've discovered the reason why I get a warning from Excel - any parameter in query string will trigger such a warning, even for static files:

http://localhost/1.xls

works ok

http://localhost/1.xls?testparam=paramvalue

gives a warning.

Will use URL rewrite to encode parameters.

0

精彩评论

暂无评论...
验证码 换一张
取 消