Extracting zip contents at server

2 posts, 0 answers
  1. Sameer
    Sameer avatar
    20 posts
    Member since:
    Apr 2013

    Posted 02 Jul 2013 Link to this post


    In one of my page, I am using this control to upload a single zip file. So does it provide an option to extract contents at the target some how?

  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 Jul 2013 Link to this post

    Hi Sameer,

    Please have a look at the following code I tried which works fine at my end. In the following code the uploaded zip file is present in the "zipPath". For the following code to work you need to reference the System.IO.Compression.FileSystem dll. The particular DLL can be downloaded from this link.

    protected void RadButton2_Click(object sender, EventArgs e)
        string zipPath = Path.Combine(Server.MapPath("~/Images/FinalUpload"), "User1.zip");
        ZipFile.ExtractToDirectory(zipPath, "E:/");

Back to Top