Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8371361
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:08:39+00:00 2026-06-09T14:08:39+00:00

I have DotNetZip installed and running fine on a Windows 2008 server. Using a

  • 0

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 C:\Inetpub\wwwroot\appname\_temp\

I’m using the following code:

Set objZip = CreateObject("Ionic.Zip.ZipFile")
sFileArray = Split(sFileArray, "|")
For iCount = 0 To UBound(sFileArray)
If sFileArray(iCount) <> "" Then
objZip.AddFile sFileArray(iCount)
End If
Next
objZip.Name = sFilePath & "test.zip"
objZip.Save()
objZip.Dispose()
Set objZip = Nothing

I see that the AddFile 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 objZip.AddFile sFileArray(iCount), "" should put the file in the root of the zip file.

However, when I add that parameter, I get the following error:

 Wrong number of arguments or invalid property assignment: 'objZip.AddFile' 

Anyone have any idea what I’m doing wrong?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T14:08:40+00:00Added an answer on June 9, 2026 at 2:08 pm

    I think you are misinterperting the documentation. If the second parameter is null then the directory path of the file being added is used. If the second parameter is an empty string “” then the file is added to the root level in the zip. A quick look into the Ioniz.zip.dll shows that the single parameter override of AddFile method simply calls the the double parameter override with the second parameter set to null.

    Hence your add file should look like:

    objZip.AddFile sFileArray(iCount), ""
    

    to get the result you are after.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a bunch of AES256-encrypted ZIP containers (using DotNetZip), and I am writing
I am using DotNetZip and have noticed that i am getting permission issues on
I have a method that zips up one or more files using DotNetZip, and
Background: I support a classic ASP environment. I have a development setup locally on
have 2 questions : A computer with 32-bit address uses 2-level page table (9
I'm trying to get Selenium 2 WebDriver up and running locally on Windows 7.
i use DotNetZip in my project. using (var zip = new ZipFile()) { zip.ProvisionalAlternateEncoding
I have problems in using SharpZipLib with isolated storage in WP7 to zip subfolders
We have a batch-based buildprocess and we are using MSBuild only for compiling our
I want to have my form in a wizard style and so I used

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.