Unzip (Extract) a Zip file from Folder using C# .Net

Last Reply on Mar 17, 2015 02:15 AM By Mudassar

Posted on Mar 17, 2015 02:15 AM

Hello, I am using this article


My question is on how to unzip file without the file upload, since there's no fieupload, the file will manually code behind.

For example:

file.zip, then it will be unzip in the folder files.

The file.zip is fixed in code behind.


Posted on Mar 17, 2015 02:15 AM

This way

protected void Upload(object sender, EventArgs e)
    string extractPath = Server.MapPath("~/Files/");
    using (ZipFile zip = ZipFile.Read(Server.MapPath("~/Files/Test.zip")))
        zip.ExtractAll(extractPath, ExtractExistingFileAction.DoNotOverwrite);
        GridView1.DataSource = zip.Entries;