How to not preserve full file path in zip file

May 13, 2011 at 6:35 PM

Noticing that when I do a the full file path of the files being added to the zip file is getting preserved.  For example if c:\temp1\test.txt is added to c:\temp2\, when I navigate the contents of c:\temp2\ it shows \temp1\tes.txt.  I guess I'm looking for the equivalent of Winzip's "Save full path info" or rather the ability to "uncheck" that option.  Does this exist in DotNetZip?  Thanks for a great product.



May 19, 2011 at 7:14 PM

yes, call ZipFile.AddFile(filename, "");

This is a FAQ.  Search the discussions archive, and you will see full code examples.