first of all, I don't know if it's legal to do this, but please read this question to understand me better.
as you read in the question, I have trouble pushing new files into an input, I knew that I get only the last file because of pushing the files into input's file list. so I changed pushing from this: (which was working, but only on last input in the form)
function inputImage(quode, f){
let list = new DataTransfer();
list.items.add(f);
let img = list.files;
document.querySelector("#imageUploader_"+quode).files = img;
}
to this:
function inputImage(quode, f){
document.querySelector("#imageUploader_"+quode).files.push(f);
}
but I get this error
document.querySelector(...).files.pushis not a function
I get it from this answer
I've also tried this
function inputImage(quode, f){
document.querySelector("#imageUploader_"+quode).files.add(f);
}
but I get this
TypeError:
document.querySelector(...).files.addis not a function
the file object looks like (from the console):
File {
lastModified: 1642515255138
lastModifiedDate: Tue Jan 18 2022 17:14:15 GMT+0300 (GMT+03:00) {}
name: "[(33),12,2314,100,45].jpeg"
size: 8115
type: "image/jpeg"
webkitRelativePath: ""
[[Prototype]]: File
}
the file list :
FileList {length: 0[[Prototype]]: FileList}

EDIT: see this it may help
and this is some documentation:
the reason wasn't related to datatransfer even nor related to JS. the problem that I wasn't managing the request array perfectly, so I only get the last input's file, so I changed the request from this
to this