title: Trying to submit form data using JQuery results in empty Reqest.Files inside C#
body: <p>HTML:</p>
  
  <pre><code>&lt;form action="~/BlogPost/UploadHomeReport" method="post" enctype="multipart/form-data" id="upload-image-form"&gt;
         &lt;input type="file" id="image-upload" /&gt;
   &lt;/form&gt;
  </code></pre>
  
  <p>Jquery:</p>
  
  <pre><code>$(document).on("change", "#image-upload", function(e) {
      $("#upload-image-form").submit();
  }
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code> public JsonResult UploadHomeReport()
      {
          try
          {
              foreach (string upload in Request.Files)
              {
                  if (Request.Files[0] != null)
                  {
  
                      var fileName = Path.GetFileName(upload);
                      MemoryStream target = new MemoryStream();
                      Request.Files[0].InputStream.CopyTo(target);
                      byte[] data = target.ToArray();
                      var path = Server.MapPath("~/App_Data/Images/" + fileName);
                      using (WebClient client = new WebClient())
                      {
                          client.UploadData(path, data);
                      }
                  }
              }
          }
          catch (Exception)
          {
              Response.StatusCode = (int)HttpStatusCode.BadRequest;
              return Json("Upload failed");
          }
  
          return Json("File uploaded successfully");
      }
  </code></pre>
  
  <p>Why does Request.Files become an empty file?
  <a href="https://i.stack.imgur.com/jDknJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jDknJ.png" alt="enter image description here"></a></p>
  
  <p>I have done this before and then it works but i just can't get it to work now.</p>