Created
November 11, 2015 09:47
-
-
Save belchev/ae3ca7c2f925352fcdc4 to your computer and use it in GitHub Desktop.
C# Unzip
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using (ZipArchive archive = new ZipArchive(model.File.InputStream, ZipArchiveMode.Read)) | |
{ | |
//archive.ExtractToDirectory(Statics.TemplatesPath); | |
foreach (ZipArchiveEntry entry in archive.Entries) | |
{ | |
string fullPath = Path.Combine(Statics.TemplatesPath, entry.FullName); | |
if (string.IsNullOrEmpty(entry.Name)) | |
{ | |
Directory.CreateDirectory(fullPath); | |
} | |
else | |
{ | |
entry.ExtractToFile(fullPath, false); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Focused dashboard,!Fine-grained permissions..?Repositoryne..!