yes even i have used XCEEDZip.DLL to zip my folders & files on server
just call the DLL & it wld do the rest for u :)
Main Topics
Browse All TopicsHow can I create a winzip file using coldfusion code? Can this be done, or do I need to
use a diffrent scripting language for this like Visual Basic?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
if you're using MX, you can use the this UDF
Usage:
<cfscript>
ZipFileNew(expandpath('fil
</cfscript>
--------------------------
<cfscript>
/**
* Create a zip file of a directory or just a file.
*
* @param zipPath File name of the zip to create. (Required)
* @param toZip Folder or full path to file to add to zip. (Required)
* @return Returns nothing.
* @author Nathan Dintenfass (nathan@changemedia.com)
* @version 1, October 15, 2002
*/
function zipFileNew(zipPath,toZip){
//make a fileOutputStream object to put the ZipOutputStream into
var output = createObject("java","java.
//make a ZipOutputStream object to create the zip file
var zipOutput = createObject("java","java.
//make a byte array to use when creating the zip
//yes, this is a bit of hack, but it works
var byteArray = repeatString(" ",1024).getBytes();
//we'll need to create an inputStream below for writing out to the zip file
var input = "";
//we'll be making zipEntries below, so make a variable to hold them
var zipEntry = "";
//we'll use this while reading each file
var len = 0;
//a var for looping below
var ii = 1;
//a an array of the files we'll put into the zip
var fileArray = arrayNew(1);
//an array of directories we need to traverse to find files below whatever is passed in
var directoriesToTraverse = arrayNew(1);
//a var to use when looping the directories to hold the contents of each one
var directoryContents = "";
//make a fileObject we can use to traverse directories with
var fileObject = createObject("java","java.
//
// first, we'll deal with traversing the directory tree below the path passed in, so we get all files under the directory
// in reality, this should be a separate function that goes out and traverses a directory, but cflib.org does not allow for UDF's that rely on other UDF's!!
//
//if this is a directory, let's set it in the directories we need to traverse
if(fileObject.isDirectory(
arrayAppend(directoriesToT
//if it's not a directory, add it the array of files to zip
else
arrayAppend(fileArray,file
//now, loop through directories iteratively until there are none left
while(arrayLen(directories
//grab the contents of the first directory we need to traverse
directoryContents = directoriesToTraverse[1].l
//loop through the contents of this directory
for(ii = 1; ii LTE arrayLen(directoryContents
//if it's a directory, add it to those we need to traverse
if(directoryContents[ii].i
arrayAppend(directoriesToT
//if it's not a directory, add it to the array of files we want to add
else
arrayAppend(fileArray,dire
}
//now kill the first member of the directoriesToTraverse to clear out the one we just did
arrayDeleteAt(directoriesT
}
//
// And now, on to the zip file
//
//let's use the maximum compression
zipOutput.setLevel(9);
//loop over the array of files we are going to zip, adding each to the zipOutput
for(ii = 1; ii LTE arrayLen(fileArray); ii = ii + 1){
//make a fileInputStream object to read the file into
input = createObject("java","java.
//make an entry for this file
zipEntry = createObject("java","java.
//put the entry into the zipOutput stream
zipOutput.putNextEntry(zip
// Transfer bytes from the file to the ZIP file
len = input.read(byteArray);
while (len GT 0) {
zipOutput.write(byteArray,
len = input.read(byteArray);
}
//close out this entry
zipOutput.closeEntry();
input.close();
}
//close the zipOutput
zipOutput.close();
//return nothing
return "";
}
</cfscript>
Business Accounts
Answer for Membership
by: shooksmPosted on 2003-07-18 at 11:50:43ID: 8954324
There are several ways varying in expense and difficulty. The easiest but obviously more expensive is to buy a component like:
products/Z ipCompL/in dex.htm
https://www.xceedsoft.com/
And use the component in your Cold Fusion code.
A cheaper solution is to install Winzip on your server with the command line support and use the CFEXECUTE tag to create the zip. Then you can use the CFCONTENT tag to send the zip through the browser.
I am not certain but I think PHP has native support for zipping files that you may want to look into.