I'm collecting data in a form and calling this js:
fetch('process.php', {
method: 'POST',
body: formData,
}).then(response => alert( response ) );
process.php gets called correctly; i perform my ops and then i try to return a confirmation message, or a failure message like this:
echo json_encode('Upload completato correttamente');
But i can't get the message to show in the alert: i only get "[object promise]" and playing around with the response i can't seem to read the message.
Any help?