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