Zip Folders with Subfolders

2 posts, 0 answers
  1. Michael
    Michael avatar
    1 posts
    Member since:
    Feb 2015

    Posted 10 Nov 2015 Link to this post

    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



  2. Nikolay Demirev
    Nikolay Demirev avatar
    136 posts

    Posted 13 Nov 2015 Link to this post

    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 zip 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.

    Nikolay Demirev
    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
Back to Top