压缩文档时,我很难重命名文件。就在下面,我正在尝试从文档中获取字符串,替换并保存为具有 UUID 文件名的文档。我希望将文件的名称更改为压缩文件时可读的名称。我该怎么做?
<cfset rtf = FileRead(filepathofdocument) />
<cfset rtf = Replace(rtf,"%newProdYN%",session.input.inputtext) />
<cfset rtf = Replace(rtf,"%ration%",session.input.inputtext2) />
<cfset cfdest = "#GetDirectoryFromPath(session.input.storage.destination)#/#CreateUUID()#.doc" />
<cffile action = "write"
file = "#cfdest#"
output = "#rtf#">
<cfzip action="zip" file="#getTempDirectory()#/#CreateUUID()#.zip">
<cfzipparam source="#cfdest#" entrypath="document.doc" />
<!-- More file sources to zip... -->
</cfzip>
标签的入口路径cfzipparam
似乎不起作用...
编辑:我实际上已经按照 Ben Nadel 博客的教程进行操作。http://www.bennadel.com/blog/795-learning-coldfusion-8-cfzip-part-ii-zipping-files-and-directories-with-cfzipparam.htm