Answers for "type of file input type in js"

9

file input file types

<input type="file" accept=".gif,.jpg,.jpeg,.png,.doc,.docx">
Posted by: Guest on May-05-2020
0

how to get file type in javascript

function showType(fileInput) {
  var files = fileInput.files;

  for (var i = 0; i < files.length; i++) {
    var name = files[i].name;
    var type = files[i].type;
    alert("Filename: " + name + " , Type: " + type);
  }
}
Posted by: Guest on October-25-2021

Browse Popular Code Answers by Language