I'm trying to zip a directory using cfzip with no success. The newly created directory contains PDFs. The code:
<cfset tempDir = getTempDirectory() />
<cfset userDirName = CreateUUID() />
<cfset userTempDir = #tempDir# & #userDirName# />
<cfloop query="data">
Create PDFs...[cfdocument]
<cffile action="write" file="#userTempDir#\#name#.pdf" output="#pdf_output#" addnewline="no" nameconflict="makeunique" />
</cfloop>
<cfzip action="zip" source="#userTempDir#" file="#tempDir#/testZIP.zip" recurse="yes" />
Everything executed nicely but cfzip. When the cfzip line tries to execute the following error comes up:
The page you were executing caused an internal server error
Request /applications/useritems/resources-cors/cfScripts/Print/Print.cfc
File Trace E:/Tomcat/webapps/openbd/applications/useritems/resources-cors/cfScripts/Print/Print.cfc
Type Internal
Tag Context CFZIP (E:/Tomcat/webapps/openbd/applications/useritems/resources-cors/cfScripts/Print/Print.cfc, Line=1018, Column=13)
|
+-- CFIF (E:/Tomcat/webapps/openbd/applications/useritems/resources-cors/cfScripts/Print/Print.cfc, Line=818, Column=9)
|
+-- CFFUNCTION (E:/Tomcat/webapps/openbd/applications/useritems/resources-cors/cfScripts/Print/Print.cfc, Line=814, Column=5)
Stack Trace
java.lang.NullPointerException
at com.naryx.tagfusion.expression.function.file.Zip.execute(Unknown Source)
at com.naryx.tagfusion.cfm.tag.io.cfZIP.createZip(Unknown Source)
at com.naryx.tagfusion.cfm.tag.io.cfZIP.realRender(Unknown Source)
at com.naryx.tagfusion.cfm.tag.io.cfZIP.render(Unknown Source)
What am i missing here?