add response in view

main
vitrinekast 12 months ago
parent 1f99151f3c
commit 9309a7451e

1
.gitignore vendored

@ -0,0 +1 @@
./webinterface/uploads

@ -14,6 +14,7 @@
<header>
<h1>Signal lost archive unzipped</h1>
<p>some info on what this even is</p>
<span class='fn-error'></span>
</header>
<button class='fn-start-recording button--record'>

@ -12,8 +12,9 @@ var sendFile = async function (blob) {
method: 'POST',
body: formData
});
console.log(response.json())
return response.json()
}
var initRecording = function (autostart) {
@ -42,7 +43,9 @@ var initRecording = function (autostart) {
const audioURL = window.URL.createObjectURL(blob);
audioEl.src = audioURL;
console.log(audioEl.src);
sendFile(blob);
sendFile(blob).then((data) => {
document.querySelector(".fn-error").textContent = data
});
}
if (autostart) {

@ -9,9 +9,9 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
// TODO check file type
if (move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)) {
echo "File is valid, and was successfully uploaded.\n";
echo json_encode("File is valid, and was successfully uploaded.\n");
} else {
echo "Possible file upload attack!\n";
echo json_encode( "Possible file upload attack!\n");
}
}
?>
Loading…
Cancel
Save