item has been already added

Dec 28, 2010 at 12:19 PM

Hello, I have this problem with dotnetzip lib. I add some folders to my zip file thru  

zip.AddDirectory(Folder);

Now, if a folder contains a file with the same name of a file in another folder, it issues an exception "an item with the same key has already been added".

Of course it's normal ( think at readme.txt, or any other document a user can have with the same name, but in different folders...) but can't understand why this cases are refused by dotnetzip.

What can I do to have my zip file ? shoud I use another way to add files ? I cannot avoid to have 2 file with same name (of course in different folders).

Thanks ! Saverio

 

Dec 28, 2010 at 12:45 PM

..too obvious ! I left blank the second arguments of the method, while it has to contain System.IO.Path.GetFileName(Folder) !

happy new year guys

 

Coordinator
Jan 6, 2011 at 7:35 PM

yes, that sounds right.  I'm glad you figured it.

happy new year to you, too.