title: Upload multiple files & create zip
body: <p>I managed to upload two kinds of files successfully &amp; store the respective filepaths on the database. Now,I'd also like to create a zip with both files attached to it. </p>
  
  <p><em>I referenced the codes to this particular webpage regarding zip files &amp; file uploads
  <a href="http://www.c-sharpcorner.com/uploadfile/5089e0/how-to-create-zip-in-asp-net-using-c-sharp/" rel="nofollow">http://www.c-sharpcorner.com/uploadfile/5089e0/how-to-create-zip-in-asp-net-using-c-sharp/</a></em></p>
  
  <p>Upon clicking the submit button, a File Not Found exception is thrown.
  An exception of type 'System.IO.FileNotFoundException' occurred in Ionic.Zip.dll but was not handled in user code</p>
  
  <p>Additional information: C:\Users\seldarine\Desktop\Proj\PP_PJ\PP_Project\SFiles\Submissions\blueteam\MyCodesF.zip</p>
  
  <p>The exception is thrown at this particular line - <strong>objZip.Save(Path.Combine(serverFilePath,zipName));</strong></p>
  
  <p>Here are a portion of my codes :</p>
  
  <pre><code>  protected void btn_submit_Click(object sender, EventArgs e)
      {
          string input = "";
          string pp, vv,zip;
          string extPp, extVv;
  
          if (f_slide.HasFile &amp;&amp; f_video.HasFile)
          {
              //Get file name &amp; extensions
              pp = Path.GetFileName(f_slide.PostedFile.FileName);
              extPp = Path.GetExtension(pp);
              vv = Path.GetFileName(f_video.PostedFile.FileName);
              extVv = Path.GetExtension(vv);
  
              string user = Session["userid"].ToString();
              //where zip name is named after the username (current user)  logged in
              string zipName = user + ".zip";
  
              //To save to folders
              string filePath = "SFiles/Submissions/" + user + "/";
              string serverFilePath = Server.MapPath(filePath);
  
              //If directory does not exist
              if (!Directory.Exists(serverFilePath))
              { // if it doesn't exist, create
                  System.IO.Directory.CreateDirectory(serverFilePath);
              }
  
              //****To create zip file*****
              using(ZipFile objZip = new ZipFile())
              {
                  string zipSlidePath = Path.Combine(serverFilePath,pp);
                  string zipVideoPath = Path.Combine(serverFilePath,vv);
                  objZip.AddFile(zipSlidePath);
                  objZip.AddFile(zipVideoPath);
                  ***objZip.Save(Path.Combine(serverFilePath,zipName));***
              }
  
              //Store files
              f_slides.SaveAs(Path.Combine(serverFilePath, pp));
              f_video.SaveAs(Path.Combine(serverFilePath, vv));
  
              .....
  </code></pre>