ColdFusion 8 always opens .XLS, want .XLSX

不想你离开。 提交于 2020-01-03 13:08:22

问题


I am using ColdFusion 8. Doing something like this:

<cfheader name="content-disposition" value="attachment; filename=abc.xlsx">
<cfcontent type="application/msexcel">
<html> 

But I get a file like abc.xlsx.XLS.

The reason I'm trying to get an XLSX is because sometimes the XLS version is so large and Office 2007 gets stuck opening it or takes way to long.

Only workaround right now is to wait, open the XLS in Office 2007, save as .XLSX and then open it faster.

Any help is appreciated!


回答1:


I would suggest that the slow opening is because you are providing the data in an HTML format, not because of the extension. You could test this by saving the file directly from the browser, renaming it with the xlsx file extension, and opening it.

If you want to save data in an Excel format directly, I would check out Ben Nadel's POI CFC project.




回答2:


I believe that the MIME type for Excel 2007 .xlsx files is "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet". I found an article on the Office Resource Kit Blog that calls this out after googling around a little.



来源:https://stackoverflow.com/questions/1240528/coldfusion-8-always-opens-xls-want-xlsx

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!