title: jQuery - Illegal invocation ajax FormData
body: <p>I was following this example: <a href="https://stackoverflow.com/questions/5392344/sending-multipart-formdata-with-jquery-ajax">Sending multipart/formdata with jQuery.ajax</a> but I got a <code>Uncaught TypeError: Illegal invocation</code>. I was wondering what went wrong. The following is the code I'm using:</p>
  
  <pre><code>  upload()
    {
      var dataimg = new FormData();
      dataimg.append('file', $("#file")[0].files[0]);
  
      $.ajax({
          url: "src/php/upload.php",
          type: "post",
          cache : false,
          contentType : false,
          processType : false,
          data: dataimg,
          success: function(data) {
            //this.setState({data : JSON.parse(data)});
            console.log(data);
          }
      });
    }
  </code></pre>