javascript - How to read blob content appended as formData.append
one text
Solution:
Remove the last ',' int fd.append('blob', blob, );.
Check your variable $_POST server side with var_dump.
For help u, u can create a div like <div id="output"></div> and print the server response by changing this if
if (xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.status);
}
into this if
if (xhr.readyState == 4 && xhr.status == 200) {
console.log(xhr.status);
document.getElementById('output').innerHTML = xhr.responseText;
}
EDIT :
Data not in the $_POST but in the $_FILES
Source