diff --git a/assets/script.js b/assets/script.js index d901fca..2025b61 100644 --- a/assets/script.js +++ b/assets/script.js @@ -552,10 +552,9 @@ async function uploadFile() { let data = { action: "uploadFiles" }; - let i = 1; - fileInput.files.forEach((file) => { - data[`userFile${i}`] = file; - }); + for (let i = 0; i < fileInput.files.length; i++) { + data[`userFile${i}`] = fileInput.files[i]; + } await doAction("/upload", data, "Súbor bol úspešne nahraný", "Nastala chyba pri nahrávaní súboru", false); fileInput.reset(); }