removing duplicate files uploaded via html input is not possible

you can simply do it by comparing files name.

arr = [];
function onFileInput(e) {
  let files = e.target.files;
  for (let i = 0; i < files.length; i++) {
    if (arr.indexOf(files[i].name) === -1) { 
       arr.push(files[i]);
    }
  }
}

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top