Added error messages

This commit is contained in:
2025-05-17 10:32:33 +03:00
parent e21ba3e213
commit 8a1aa398d9
4 changed files with 20 additions and 2 deletions
+5 -1
View File
@@ -32,7 +32,11 @@ setEventListeners(upload, async () => {
method: 'POST',
body: formData
}).then((response) => {
location.reload();
if (!response.ok) {
alert(`Upload unsuccessful. ${response.status}`);
} else {
location.reload();
}
});
}
const onSelectFile = () => upload(input.files[0]);