Note that there are some explanatory texts on larger screens.

plurals
  1. POUnzipping two different zip files with sharpziplib to the same directory
    text
    copied!<p>I have looked around quite abit and there does not seem to be any information on using sharpziplib to extract multiple zip files to the same directory. I am using telerik control RadUpload to upload two different zip folders and when uploaded they are automatically unzipped into a folder with the same name as the zip to the same directory.</p> <p>For example: I have autocorrect.zip and entertainment.zip. Autocorrect extracts to a folder called "autocorrect" and entertainment extracts to a folder called "entertainment". Autocorrect is in the first box and entertainment in the second.</p> <p>But in the extract folder only "entertainment" appears. Now I think this is because the way I current have the unzip method set up as it takes in the first value "autocorrect" and then it also takes"entertainment" as the first value afterwards therefore "autocorrect" is no longer listed to be extracted.</p> <p>Here is my code for the unzip method if you believe other parts of my code would help please say and I'll post more:</p> <pre><code>public static void UnZip(string sourcePath, string targetPath) { //Creates instance of fastzip from library ICSharpCode ICSharpCode.SharpZipLib.Zip.FastZip fz = new FastZip(); //Extracts zip from sourcePath to target path which is chosen in the button click methods fz.ExtractZip(sourcePath, targetPath, ""); } </code></pre> <p>EDIT: Here is the button method which calls the unzip with the save path for the zip files and save path for the extracted zips (Forgot to say it works perfectly for one zip but not for multiple zips)</p> <pre><code> protected void SubmitButton_Click(object sender, EventArgs e) { //Gets the name of the file being uploaded foreach (UploadedFile file in RadUpload1.UploadedFiles) { fileName = file.GetName(); } //Path where zip files are uploaded String savePath = @"C:\Users\James\Documents\Visual Studio 2012\WebSites\CourseImport\CourseTelerik\"; //Adds name of uploaded file onto end of saved path savePath += fileName; //Path where the extracted files from the uploaded zip are placed String unZipPath = @"C:\Users\James\Documents\Visual Studio 2012\WebSites\CourseImport\CourseTelerikExtract\"; unZipPath += fileName; //Runs unzipping method UnZip(savePath, unZipPath); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload