There are many components that will allow you to do this. Remember that these components are designed to allow ASP to zip and unzip files that are on the SERVER. If you are interested in zipping / unzipping files that the client has, these components will be no good to you unless you first
upload the files to the server!
RemoteZip/ServerZip Xceed Zip SA-Archive WaspZip Zbit Zip-Unzip I've used the last component in the list, Zbit's Zip/Unzip. It is simple yet robust and very reliable. After much testing, I am about to deploy it in a commercial project.
Using PKZip Command Line with Windows Script Host - sample code! Assuming, of course, that you have
Windows Script Host installed, and that you have the ability to install programs and alter configuration on your server, you can call PKZip Command Line from Windows Script Host (which, in turn, you can run from ASP). Here are some instructions to get you started:
- Download PKZip Command Line from PKWare
- Run the install for PKZip Command Line
The following steps are required in Windows 2000 and Windows XP.
- Right-click My Computer, hit Properties
- On the Advanced tab, click Environment Variables
- Under 'User variables for <USER>', you will find the PATH variable
- This PATH variable will include the PKZip folder
- Click Edit... and copy the PKZip folder section
- Under System Variables, double-click PATH
- Add a semi-colon to the end of the path, and paste the PKZip folder without the quotes
- Click OK, Apply, and OK.
Now, provided IUSR_<machine> has appropriate permissions to the destination folder, you can run a script like this:
<% set shell = CreateObject("WScript.Shell") zipCommand = "pkzipc -add " & server.mappath("/") & "\test.zip c:\*.log" shell.Run zipCommand, 1, true set shell = nothing %> |