Rewrite some stuff

This commit is contained in:
Bruno Rybársky 2024-04-26 14:59:04 +02:00
parent 0a19b9a778
commit c41e3c2049

@ -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();
}