title: Upload files using ajax in MVC
body: <p>I've been trying to upload a file async using ajax as I need to keep a lot of elements in my page so I can't really afford to refresh the page without putting inputted values back.</p>
  
  <pre><code>//clear data
              elements = [];
  
              //get current data
              var files = $('input[type=file]');
              var formData = new FormData();
              for (var i = 0; i &lt; files.length; i++)
                  if (files[i].files.length &gt; 0)
                  {
                      elements.push(files[i].name);
                      formData.append(files[i].name, files[i]);
                  }
  
  $.ajax({
                      url: "/Monitoring/UploadFiles",
                      type: 'POST',
                      data: formData,                    
                      processData: false, // Don't process the files
                      contentType: false, // Set content type to false as jQuery will tell the server its a query string request
                  });
  </code></pre>
  
  <p>This is what I tried so far but I'm not getting any files in my controller method. I do get something in <code>Request.Form</code> but it's a string with the value <code>"[HTMLInputElement"]</code>.</p>
  
  <p>What am I doing wrong?</p>