[Answer]-Ajax POST request is empty

1👍

Try serializing the form data instead of creating a new FormData object. Like:

var $form = $("#form_upload").find('form');
var fd = $form.serialize();
// ...

0👍

Try the following:

var fd = new FormData($("#form")[0]);

Also, make sure, your form declaration is correct:

<form id="form" enctype="multipart/form-data">                        
    <input type="file" name="file" />
</form>

Leave a comment