title: How to upload multiple files asynchronously in ASP.NET MVC (C#) using Progress Bar
body: <p>I am building an MVC based ASP.NET application. One of the functionalities should be to be able to upload files asynchronously using a progress bar. </p>
  
  <p>I've had success with uploading files without the progress bar. The code below does that. </p>
  
  <p>View Code:</p>
  
  <pre><code>&lt;input class="file" type="file" name="file" id="file" /&gt;
  &lt;input type="submit" name="submit" value="Upload" /&gt;
  </code></pre>
  
  <p>Controller Code:</p>
  
  <pre><code>    public ActionResult Upload(){
          return View();
      }
  
      [HttpPost]
      public ActionResult Upload(Resource resource)
      {
          try
          {
              if (resource.File.ContentLength &gt; 0)
              {
                  var fileName = Path.GetFileName(resource.File.FileName);
                  var path = Path.Combine(Server.MapPath("~/Content/Resources"), fileName);
                  resource.File.SaveAs(path);
              }
          }
          catch (Exception e)
          {
              Console.WriteLine("Cannot upload file. Exception of type : {0}", e.ToString());
          }
          return RedirectToAction("Upload");
      }
  </code></pre>
  
  <p>This code works absolutely fine. With slight modifications, I am even able to upload multiple files. But, even though I've tried finding it, I am not able to upload files using a progress bar. </p>
  
  <p>Any help is appreciated. </p>