I'm having difficulty to rename a file when a document is zipped. Right below, I'm trying to get strings from a document, replace and save as a document with UUID file name. I would like the name of the file to be changed as something that is readable when the file is zipped. How can I do it?
<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>
The entry path of cfzipparam
tag does not seem to work...
Edited: I have actually follow the tutorial by Ben Nadel blog. http://www.bennadel.com/blog/795-learning-coldfusion-8-cfzip-part-ii-zipping-files-and-directories-with-cfzipparam.htm