Coldfusion - PDF创作

时间:2015-12-07 14:17:46

标签: coldfusion

我正在使用ColdFusion 10生成PDF文档并将其保存在Web目录中。目前,我正在生成PDF将其保存在我服务器上的目录中并将其FTP到给定的Web目录。有一个更好的方法吗? 感谢

1 个答案:

答案 0 :(得分:1)

如果要在同一服务器上移动文件,可以使用cffile action = "move"cffile action = "rename"。唯一的区别是move操作将执行(顾名思义)移动操作,而rename操作会将文件复制到新位置并同时重命名。

Rename

<cffile  
action = "rename" 
destination = "D:\files\upload\keymemo.doc"  
source = "c:\files\upload\keymemo.doc" 
attributes = "file attributes list" 
mode = "mode">

Move

<cffile  
    action = "move"  
    source = "c:\files\upload\keymemo.doc"  
    destination = "d:\files\upload\memo\">

但是如果要将文件移动到ColdFusion服务器以外的位置,则应使用cfftp来执行此操作。 https://helpx.adobe.com/coldfusion/cfml-reference/coldfusion-tags/tags-f/cfftp-connection-file-and-directory-operations.html

<cfftp
connection = "myConnection"
action = "putFile"
name = "uploadFile"
transferMode = "binary"
localFile = "c:\files\upload\keymemo.doc"
remoteFile = "/ftpfolder/keymemo.doc">