English 中文(简体)
能否下载冷聚的文档变量?
原标题:Is it possible to download a file variable in coldfusion?
  • 时间:2011-11-23 13:16:38
  •  标签:
  • coldfusion

采用“冷聚”(>SpreadSheet()”的物体,我建立了“Excel”文档,现在用户需要能够下载。

mySS = SpreadsheetNew();
format1 = StructNew();
format1.color="dark_green";
format1.size="24"; 
SpreadSheetSetCellValue(mySS, 7,2,3);
SpreadSheetFormatCell(mySS, format1, 2, 3);

基本上,我喜欢这样的东西。

<cfdownload var="#mySS#">

然而,这几乎从未如此简单。 我认识到,我可以撰写文件,然后使用<代码>cfheadercfcontent。 然而,尽管如此,但还是如此。 我尽量避免撰写档案。

<><>Edit>/strong>

根据这一建议,我从speshak 。 审判

<cfcontent variable="#mySS#"  type="application/msexcel">

and the error I got was, am I missing something?

coldfusion.excel.ExcelInfo is not a supported variable type. The variable is expected to contain binary data.

最佳回答

Alright so thanks to Raymond Camden s Post and speshak here is the final solution.

<cfheader name="Content-Disposition" value="attachment;filename=filename.xls">
<cfcontent variable="#spreadsheetReadBinary(mySS)#"  type="application/msexcel">
问题回答

Try:

<cfcontent/2007/5>#mySS#”>

也许,你也想确定这种特性,因此浏览器知道它不是超文本。





相关问题
JQuery AJAX .load - flash chart doesnt load in IE

An IE issue has me completely stumped. I have a coldfusion page that uses JQuery s AJAX .load function to load in a new flash file that is generated by coldFusion s cfchart tag. This works completely ...

Best Coldfusion Library for OpenID [closed]

I am getting ready to start a project that requires using OpenID within Coldfusion 8. I have found a number of different options and was wondering what has worked the best, get s the most support, ...

Find ColdFusion Generated ID

Is there a way to find the elements generated by ColdFusion s <CFLayout> and <CFLayoutArea> tags? These tags: <cflayout type="tab" name="MyAccount"> <cflayoutarea name="...

ColdFusion COM error

I am upgrading from CF4.5 to CF8. Calls to COM dll s that used to work in version 4.5 now throw a "Complex object types cannot be converted to simple values.." error. The COM object has a few arrays ...

What s the best way to write engine-specific CFML code?

Sometimes it is necessary to write different code for Adobe ColdFusion vs Railo vs OpenBD, due to differences in implementation. Do people have a specific method that they use for this? For example, ...

热门标签