This is a migrated thread and some comments may be shown as answers.

Zip Folders with Subfolders

1 Answer 392 Views
ZipLibrary
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 10 Nov 2015, 02:16 PM

Is there any way to zip a folder with all sub-folders included?

I can go through each subdirectory and zip its contents - but it doesn't keep the directory structure, and results in all files (from each sub folder) in the one directory

Any help appreciated

 

Michael

1 Answer, 1 is accepted

Sort by
0
Nikolay Demirev
Telerik team
answered on 13 Nov 2015, 08:26 AM
Hi Michael,

If you create entries with filenames relative to the root directory of the archive as the zip is a separate directory structure it will create subfolders. For example, if you create an entry with entry name "folder/file.ext" this will result in  file containing a folder named "folder" and in this folder there will be a file named file.ext.

Another way to zip entire directory with all of its subdirectories and files is to use the ZipFile.CreateFromDirectory located in Telerik.Windows.Zip.Extensions.dll assembly.

Regards,
Nikolay Demirev
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ZipLibrary
Asked by
Michael
Top achievements
Rank 1
Answers by
Nikolay Demirev
Telerik team
Share this question
or