Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
  }
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #file #type #javascript
ADD COMMENT
Topic
Name
1+8 =