I have not tried this, but what if you change the cfcontent type to unknown?
 Like so:

<cfcontent type="unknown">
<cfheader name="Content-Disposition" value="filename=report.xlsx">


On Thu, Dec 31, 2009 at 2:37 AM, Christophe Maso <[email protected]> wrote:

>
> Have seen a few posts around the web with this problem, but no evident
> solution.  I have a cfm page that I want to make exportable to excel 2007
> (.xlsx file).  From what I've seen here:
> http://blogs.msdn.com/vsofficedeveloper/pages/Office-2007-Open-XML-MIME-Types.aspx
>
> it looks like the correct MIME type for Excel 2007 (.xlsx) files is NOT
> "vnd.ms-excel", but rather
> "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
> ". So, when the proper url var is passed to the page, I include these lines
> of code:
>
> <cfcontent
> type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
> <cfheader name="Content-Type"
> value="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet">
> <cfheader name="Content-Disposition" value="filename=report.xlsx">
>
> And in that case the user is prompted to open or save the .xlsx file.
>  However, Excel 2007 can't open the file; it gives an error message saying
> that the file format is not valid.
>
> No problem if I export it all using "vnd.ms-excel" as the MIME-type
> instead, but then it saves as an .xls file, not an .xlsx file.  Any help on
> how I can get it to save as an .xlsx file? (Using CF8).
>
> Thanks,
> CM
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Want to reach the ColdFusion community with something they want? Let them know 
on the House of Fusion mailing lists
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:329395
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

Reply via email to