How can ColdFusion work with ZIP and JAR files?
Use the <cfzip> and the <cfzipparam> tags.
<cfzip> provides access to ZIP and JAR files with the following actions:
delete: Deletes one or more files from the file.
list: Lists the contents of the file.
read: Reads the contents of the file into a variable.
readBinary: Reads the contents of a binary archived file into a variable.
unzip: Extracts files from the ZIP or JAr file.
zip: Compress files into a ZIP or JAR file.
<cfdump var="#myVar#">
Use the <cfzipparam> tag with the <cfzip> tag to zip, extract, or delete multiple files or directories. For example:
<cfzip file="c:\foo.jar" action="zip">
<cfzipparam source="c:\test1\file1.txt">
<cfzipparam source="c:\test2\test3" recurse="yes">
</cfzip>
This question was written by Jeremy Petersen.
It was last updated on December 12, 2007 at 12:09:25 PM EST.
CFML Referenced
Categories
Comments
Comment made by Jason West on May 27, 2008 at 2:19 PM
This tag is only found in Adobe CFML 8. What way would be best way for servers that are below version 8?
Comment made by Raymond Camden on May 27, 2008 at 2:30 PM
I would Google. I seem to remember a few cfzip type products that were available for CF.