2

我似乎无法使用 cfcontent 打开 powerpoint(ppt) 文档。我的代码打开其他类型的办公文档没有问题。下面是代码:

<cfheader name="content-disposition" value="attachment; filename=#qry.clientFile#"/>
<cfcontent type="#qry.contentType#/#qry.contentSubType#" variable="#qry.documentData#"/>

qry.clientFile = Presentation2.ppt
qry.contentType = 应用程序
qry.contentSubType = vnd.ms-powerpoint
qry.documentData = 文档本身

我正在使用上面的行打开其他文档没问题。另外,我正在尝试在office 2007中打开一个office 2003 ppt文件。

4

1 回答 1

1

如果您只是将文件名作为不正确的变量参数传递。您需要在变量参数中提供一个二进制变量。如果您只有磁盘上的文件,那么您需要使用 file 参数和 powerpoint 文件本身的完整驱动器路径。

http://livedocs.adobe.com/coldfusion/8/htmldocs/help.html?content=Tags_c_11.html

<cfcontent type="#qry.contentType#/#qry.contentSubType#" file="#ExpandPath(qry.documentData)#">

于 2009-09-23T02:15:49.107 回答