Skip to content
Snippets Groups Projects
Commit 7506eccb authored by HerrWaechter's avatar HerrWaechter
Browse files
parents c5424929 2a19fa50
No related branches found
No related tags found
No related merge requests found
......@@ -206,10 +206,6 @@
fileInput.addEventListener("change", (event) => {
const files = event.target.files; // Ausgewählte Dateien
if (files.length > 0) {
alert(
`Du hast folgende Datei ausgewählt: ${files[0].name}`,
);
// Überprüfung im JavaScript (optional)
const allowedExtensions = [
"jpg",
......@@ -218,7 +214,7 @@
"zip",
"txt",
];
const fileExtension = selectedFile.name
const fileExtension = files[0].name
.split(".")
.pop()
.toLowerCase();
......@@ -227,6 +223,10 @@
"Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.",
);
fileInput.value = ""; // Zurücksetzen
} else {
alert(
`Du hast folgende Datei ausgewählt: ${files[0].name}`,
);
}
}
});
......
......@@ -211,10 +211,6 @@
uploadedFile.style.display = "block";
uploadedFile.innerHTML += `<br> ${files[0].name}`;
if (files.length > 0) {
alert(
`Du hast folgende Datei ausgewählt: ${files[0].name}`,
);
// Überprüfung im JavaScript (optional)
const allowedExtensions = [
"jpg",
......@@ -223,7 +219,7 @@
"zip",
"txt",
];
const fileExtension = selectedFile.name
const fileExtension = files[0].name
.split(".")
.pop()
.toLowerCase();
......@@ -232,7 +228,11 @@
"Ungültige Datei! Bitte wähle eine Datei mit der Endung .jpg, .jpeg oder .png.",
);
fileInput.value = ""; // Zurücksetzen
}
} else {
alert(
`Du hast folgende Datei ausgewählt: ${files[0].name}`,
);
}
}
});
submitButton.addEventListener("click", () => {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment