This project is read-only.

How to zip without saving the directory info?

Jul 6, 2008 at 3:53 AM

First of all I would like to thank you for the wonderful utility you have created ! Keep the great work going !

I was wondering if there is a way to zip a file without the directory structure of that file. Basically, when I zip the file c:\test1\test2\file1.doc, and then unzip it to say D:\test3, it creates the following directory structure D:\test3\test1\test2, and extracts it there.
Here is the code I am using

                ZipFile file = new ZipFile();
                file.Password = "password";

                 ZipFile file = new ZipFile("");

Many thanks !

p.s. I am using release 1.5
Jul 6, 2008 at 3:55 AM
Edited Jul 6, 2008 at 4:03 AM
Just realized I need to set the second argument to AddFile as "".

This solves my problem.
Jul 6, 2008 at 5:06 PM

Yes, you found the answer.  I'm glad DotNetZip is working for you.

Just a reminder - DotNetZip is donationware.  If you like it, consider donating. Completely voluntary.