From c41e3c20498a786e445fca634c023aaac8241ce3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bruno=20Ryb=C3=A1rsky?= Date: Fri, 26 Apr 2024 14:59:04 +0200 Subject: [PATCH] Rewrite some stuff --- assets/script.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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(); }