We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

compression to zip file

Hello
We used the syncfusion.compression dll to compress files.
But we need to keep the folder name in the zip file ? is it possible ?
Thanks lot

Sylvie



7 Replies

PH Praveenkumar H Syncfusion Team December 20, 2013 04:36 AM UTC

Hi Sylvie,

Thank you for using Syncfusion products,

Yes we can keep the folder name in zip file . 
the sample project is attached for your reference.

Please let us know if you need further assistance.

With Regards,
Praveen


Syncfusion_compression_4f64b7d2.zip


SC Sylvie Chevojon December 23, 2013 01:31 PM UTC

Hello,
Thanks lot for your answer but I think my question is not enough detailed.
I need to zip many files in the same zip file but with the Folder name.
For exemple, I attached a exemple of zip file that I need.
We are able to add many files in a zip and able to create a directory in a zip but we don't know how we can insert a/many file in the directory of the zip file.

Thanks lot and merry christmess


Properties_7fcdc9c4.zip


PH Praveenkumar H Syncfusion Team January 2, 2014 04:08 AM UTC

Hi Sylvie,

Thank you for your update,

We are not able to download the attachment due to file server maintenance.
Please resend the attachment.

Please let us know if you need further assistance.

With Regards,
Praveen



SC Sylvie Chevojon January 8, 2014 09:19 AM UTC

Please find attached an exemple of zip file

Backup_131128_1707_f4031493.zip


GM Geetha M Syncfusion Team January 17, 2014 05:19 AM UTC

Hi Sylvie,

Sorry for the delay.

Yes, you can insert file in the zip and save it as a new zip file. Here is the code snippet:

ZipArchive zip = new ZipArchive();
zip.Open(@"C:\Backup_131128_1707_f4031493.zip");
StreamReader reader = new StreamReader(@"C:\Solinium2.config");
zip.AddItem(@"Methods\Solinium2.config", reader.BaseStream, false, FileAttributes.Archive);
zip.Save("Test.zip", true);

Please try this and let me know if you have any other questions.

Regards
Geetha


SC Sylvie Chevojon January 27, 2014 02:03 PM UTC

Ok Thanks lot.


PH Praveenkumar H Syncfusion Team January 31, 2014 04:47 AM UTC

Hi Sylvie,
    
Thank you for your update,
Please let us know if you need any further assistance

With Regards,
Praveen

Loader.
Up arrow icon