This project is read-only.

Creating a zip file with a relative path

Nov 28, 2007 at 12:03 PM


I need to be able to create a zip file of FolderA that contains files and folders. The top level entry in the zip file needs to be FolderA but instead it is the root folder of FolderA.


For example, to zip a folder with a path c:\temp\build

When opening the zip the root is temp instead of what I wanted: build

Is there any functionality within the library that can allow me do this?

Kind regards,

Dec 5, 2007 at 4:03 AM
Yes, you can do what you want. Did you try this:

Dec 5, 2007 at 11:19 AM
That's great.

Many thanks.

Dec 17, 2007 at 4:55 PM
This way will include the tail folder name of the current directory name, e.g "D:\fldr\abc" then in the zip file the root dir is "abc". Maybe this is not your expected result.

If use the overload methods AddXXX(fileOrDirectory, directoryInArchive) can resolve the issue.