title: Upload multiple images in different folders using single button
body: <p>i am doing my project in mvc4 using c#</p>
  
  <p>i my project i want to upload two image files from a folder so i use the following code.</p>
  
  <p>View:</p>
  
  <pre><code> &lt;form action="" method="post" enctype="multipart/form-data"&gt;
     &lt;label for="file1"&gt;Filename:&lt;/label&gt;
     &lt;input type="file" name="files" id="file1" /&gt;
     &lt;label for="file2"&gt;Filename:&lt;/label&gt;
     &lt;input type="file" name="files" id="file2" /&gt;
     &lt;input type="submit"  /&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>[HttpPost]
  public ActionResult Index(IEnumerable&lt;HttpPostedFileBase&gt; files) {
  foreach (var file in files) {
  if (file.ContentLength &gt; 0) {
    var fileName = Path.GetFileName(file.FileName);
    var path = Path.Combine(Server.MapPath("~/App_Data/uploads/Folder1"), fileName);
    file.SaveAs(path);
  }
  }
  return RedirectToAction("Index");
  }
  </code></pre>
  
  <p>actually my need is that i want to upload these images in different folders on a single submit button. (That is file1 into Folder1 and file2 into Folder2) is that possible??</p>