title: how can I Send File via jQuery?
body: <p>I want send a file via JQuery</p>
  
  <p>I create a form like this:</p>
  
  <pre><code>&lt;form id="form"&gt;
  &lt;input type="text"&gt;
  &lt;input type="file"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>and I use this Jquery code to send data.</p>
  
  <pre><code>    var datastring = $("#form").serialize();
  
      $.ajax({
          type: "POST",
          url: "function/formRegister",
          data: datastring,
          async: true,
          dataType: 'json',
          success: function(data)
          {
          }
  </code></pre>
  
  <p>I can send input.text value to server But I can not send input.file</p>
  
  <p>I know I must FormData. how can I use it? </p>