You don't need to serialize the form. Instead you should send an instance of the FormData
class.
$("form").submit(function(event) {
event.preventDefault();
var data = newFormData($(this)[0]);
$.ajax({
processData : false,
contentType : false,
url : "/php-script.php",
data : data,
success : function(response){
console.log(response);
}
});
});
That's a very common technique to send files via AJAX using jquery.
Post a Comment for "How To Upload By Ajax Post Serialize"