Add file at root of zip file using DotNetZip with classic ASP

uilino

New Member
I have DotNetZip installed and running fine on a Windows 2008 server.Using a classic ASP page, I want to bundle a bunch of comma-delimited files to a user and send it over in a zip file.The following code works fine but it stores all the path information so the files inside the zip file are located in some ridiculous directory like \[code\]C:\Inetpub\wwwroot\appname\_temp\\[/code\]I'm using the following code:\[code\]Set objZip = CreateObject("Ionic.Zip.ZipFile")sFileArray = Split(sFileArray, "|")For iCount = 0 To UBound(sFileArray)If sFileArray(iCount) <> "" ThenobjZip.AddFile sFileArray(iCount)End IfNextobjZip.Name = sFilePath & "test.zip"objZip.Save()objZip.Dispose()Set objZip = Nothing\[/code\]I see that the \[code\]AddFile\[/code\] method allows you to specify where you want the added file to reside in the zip file if you add a second parameter. According to the documentation \[code\]objZip.AddFile sFileArray(iCount), ""\[/code\] should put the file in the root of the zip file.However, when I add that parameter, I get the following error:\[code\] Wrong number of arguments or invalid property assignment: 'objZip.AddFile' \[/code\]Anyone have any idea what I'm doing wrong?Thanks.
 
Back
Top