title: Error when trying to send FormData with jQuery.ajax
body: <p>I have a file which I want to send to the server. The file is being passed within a FormData object and not as a path URI. This is the code I am using:</p>
  
  <pre><code>let formData = new FormData();
  formData.append('enctype', 'multipart/form-data');
  formData.append('mode', 'fileInsert');
  formData.append('conId', 'asdasd5535asf');
  formData.append('user', 'user2422424');
  formData.append('filesNumber', 1);
  formData.append('msgType', 'fil');
  formData.append('file0', file);
  
  $.ajax({
      data: formData,
      success: function (a, s) {
          debugger;
      }
  });
  </code></pre>
  
  <p>When the code reaches the <code>$.ajax</code> call it throws this error:</p>
  
  <blockquote>
    <p>Uncaught TypeError: Illegal invocation</p>
  </blockquote>
  
  <p>What is wrong? Note that the jQuery AJAX is being configured earlier, with post type, URL and such.</p>