Creating ZIP file from classic ASP

Sailor

Perch
I have a need to create a zip file of images on the server. The list of images changes frequently and it's difficult to keep the zip file up to date. I'd like to create a script so that whenever the images change we could run this script to delete the old zip and create a new one with the most recent images.
I've seen several references to using WScript.Shell to do this. Is this something that is available on Jodo servers, and would it have the appropriate permissions?

If not (and it does sound like a security problem) are there any other ways to achieve this?

thanks
 
Stephen,
That XZip component worked perfectly - does exactly what I need it to do and my client is very happy.

Thanks
 
Hi,
i'm trying to use that component, but it's not working, without throwing an error. It simply doesn't creates a zip file.

Here it is the code
Code:
<%
Dim objZip
Set objZip = Server.CreateObject("XStandard.Zip")
objZip.Pack "d://hshome/myaccount/folder/file.mdb", "d://hshome/myaccount/folder/formulare"&date()&".zip"
Set objZip = Nothing
Response.redirect "formulare"&date()&".zip"
%>

Hm, sorted. I was tryng to zip a file that was placed ouside the site folder and it's not working. But in the site folder it works.
 
That is by design, the way the security model works :)

I knew the files outside the site folder are not accesible from outside (that's why I keep my databases in a folder placed at the site folders level), but I thought they are available for scripts as dbs are.
 
Zaboss,
I haven't run that code, but at a guess I'd say the filename you end up with from this would be an illegal filename, because it's likely to contain / or other illegal characters. You might want to first get the date, replace all non-alpha characters, then use it in the file name.

Rory

Hi,
i'm trying to use that component, but it's not working, without throwing an error. It simply doesn't creates a zip file.

Here it is the code
Code:
<%
Dim objZip
Set objZip = Server.CreateObject("XStandard.Zip")
objZip.Pack "d://hshome/myaccount/folder/file.mdb", "d://hshome/myaccount/folder/formulare"&date()&".zip"
Set objZip = Nothing
Response.redirect "formulare"&date()&".zip"
%>

Hm, sorted. I was tryng to zip a file that was placed ouside the site folder and it's not working. But in the site folder it works.
 
Back
Top