ColdFusion11:CFContent不会写入可打开的excel文件

我想在ColdFusion中做一个简单的任务:生成一个excel文件,并在浏览器中下载。 我有这个:

<cfset local.sheet = SpreadsheetNew("My Spreadsheet", "true") /> <cfset SpreadsheetAddRow(local.sheet, "Col1,Col2,Col3") /> <cfheader name="content-disposition" value="attachment;filename=NiceName.xlsx" /> <cfcontent type="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" variable="#spreadsheetReadBinary(local.sheet)#" reset="true" /> 

哪个在CF9上完美工作,但是在CF11上没有。 打开文件时,它说:

Die Datei'NiceName.xlsx'由Excel提供下载免费,已经上市的数百个免费私人表格。 ÜberprüfenSie,ob die Dateibeschädigtist und ob die Dateierweiterung dem Dateiformat entspricht。

这意味着:

Excel无法打开“NiceName.xlsx”文件,因为文件格式或-ending无效。 请validation,如果文件已损坏,文件结尾对应于文件格式。


我可以:

  • <cfmailparam>表并通过邮件接收文件。
  • <cfspreadsheet action="write">表并在服务器上接收文件。

在这两种情况下,这些文件都是可读的。


我努力了:

  • <cfspreadsheet action="write">表单,然后使用<cfcontent file="#pathToFile#"> ,这是行不通的。
  • 检查我的IIS的URL重写规则。
  • 检查我的IIS的.xlsx MIMEtypes。 这和我的代码一样。
  • 最后添加了一个<cfabort> ,所以没有其他事情会发生。

但没有什么帮助。


我在用着:

  • ColdFusion 11(11,0,0,289974)与Tomcat 7.0.52.0
  • Windows Server 2008 R2 Standard 64位
  • Microsoft Office 2013
  • IIS 7.5.7600.16385

尝试使用application/vnd.ms-excel而不是openoffice变种。 这将是一个专门的哑剧types。 使用openoffice的人会自动转换,因为他们已经设置了这种方式。 这是我在这里看到的唯一的东西。