In jQuery code,
var formData = new FormData($('#content-submit')[0]);
formData.append("Title", $("input[name=Title]").val());
formData.append("Url", $("input[name=Url]").val());
formData.append("Content", $("textarea[name=Content]").text());
formData.append("Genre", $("input[name=Genre]").val());
formData.append("File", $("input[name=File]")[0].files[0]);
console.log(formData);
But console.log says
FormData {}
So I think that FormData append method doesn't work. Are there other things that I should do?
FormData
can't be inspected from the web developer console. You can only use them to create key value pairs to be sent.
If you want to debug it, you may do this,
for (var p of formData) {
console.log(p);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With