Saturday, 13 August 2022

How to print the multiple input order "File name" in html and JS

I have five files scan.pdf, "1_PVC", "2_Graham", 3_TAC, "4_TEC", I want the console.log can print retrieve the exact same string ("scan" "1_PVC" "2_Graham" 3_TAC "4_TEC") inside the filename. No matter how I get, it will eventually get from Alphabetical order "1_PVC" ... This is what I've done so far.

<input type="file" name="filess[]" id="file" accept=".pdf" multiple="multiple"  />
var filess = event.target.files;
console.log(filess);

var count = files.length;

for (var k=0; k<file.files.length; ++k){
    console.log(files[i].name + "\n");
}

enter image description here

Any method I can print the "File name:" based on user selection.



from How to print the multiple input order "File name" in html and JS

No comments:

Post a Comment