Click here to Skip to main content
15,898,222 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to add same file name in zip folder. but when i add 2nd file in zip.save(responce.outputstream). it gave an error thane same file name already exists.what should i do ????
Posted
Comments
Sergey Alexandrovich Kryukov 4-Jan-14 1:49am    
What library do you use for doing ZIP? Any code sample?
The answer is simple: you have a bug. Due to recent Christmas and New Year events, my access to your hard drive through the chimney is somewhat limited. Ho-ho-ho!
—SA
Member 10494762 4-Jan-14 1:59am    
merry Christmas and happy new year to u too ..:)
my code is like..


using System.IO.Compression;
using Ionic.Zip;

multipleFiles.AddFile(doc1, string.Empty);
multipleFiles.AddFile(doc1, string.Empty); //here it says file name already exists

multipleFiles.Save(Response.OutputStream);
HttpContext.Current.Response.End();
Sergey Alexandrovich Kryukov 4-Jan-14 2:01am    
I don't know what is Ionic.Zip. Any links?
—SA
Member 10494762 4-Jan-14 2:06am    
ok... can u please gave any suggestion what dll should i use for zip which are also capable of zip with the same file name. apart from Ionic.Zip
Member 10494762 4-Jan-14 2:13am    
thanks 4 ur reply..i got the solitions

multipleFiles.AddFile(doc1, string.Empty);//here i user folder name on(string.Empty)..it will create directory and save file inside the directory

multipleFiles.AddFile(doc1, "foldername"); //here it says file name already exists

Member 10494762 wrote:
…can u please gave any suggestion what dll should i use for zip which are also capable of zip with the same file name apart from Ionic.Zip?
Certainly.

  1. You can use #ziplib:
    http://www.icsharpcode.net/opensource/sharpziplib/[^].
  2. Another option is using SevenZipSharp, a .NET wrapper of the famous 7-Zip:
    http://en.wikipedia.org/wiki/7-Zip[^],
    http://sevenzipsharp.codeplex.com/[^].
  3. Another option is SharpCompress, a fully native .NET library for several compression formats:
    http://sharpcompress.codeplex.com[^],
    https://github.com/adamhathcock/sharpcompress[^].


All three options are open-source. I would recommend to include source project in your solution.

Good luck, Happy New Year!

—SA
 
Share this answer
 
C#
multipleFiles.AddFile(doc1, string.Empty);//here i user folder name on(string.Empty)..it will create directory and save file inside the directory

 multipleFiles.AddFile(doc1, "foldername"); //here it says file name already exists
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900