Reputation:
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!
Upvotes: 5
Views: 7533
Reputation: 7885
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.
Upvotes: 4
Reputation: 59553
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.
Upvotes: 4