Skip to main content
Participating Frequently
April 3, 2007
Answered

creating excel with cfcontent and MX

  • April 3, 2007
  • 1 reply
  • 260 views
I have some code that I have been developing on a server running CF version 5.0. I realized that we have migrated our production servers to MX and moved my code to the MX dev box. Once I did, the code I have written to create an excel file is not working the same way. With CFF 5, I would see the file show up like a spreadsheet and you could save as an xls file. After only moving the code to MX, it won't let me open the file in the browser. Any ideas what is going wrong
This topic has been closed for replies.
Correct answer insuractive
You need to use the following in CFMX:

<cfheader name="Content-Disposition" value="inline;filename=#name#">
<cfcontent type="application/vnd.ms-excel"><cfoutput>#sExcelContent#</cfoutput>

Notice the <cfheader>

1 reply

insuractiveCorrect answer
Inspiring
April 3, 2007
You need to use the following in CFMX:

<cfheader name="Content-Disposition" value="inline;filename=#name#">
<cfcontent type="application/vnd.ms-excel"><cfoutput>#sExcelContent#</cfoutput>

Notice the <cfheader>