how to use input type file and show selected file on screen code example

Example 1: how to use input type file and show selected file on screen

updateList = function() {
  var input = document.getElementById('file');
  var output = document.getElementById('fileList');

  output.innerHTML = '
    '; for (var i = 0; i < input.files.length; ++i) { output.innerHTML += '
  • ' + input.files.item(i).name + '
  • '; } output.innerHTML += '
'; }

Example 2: how to use input type file and show selected file on screen



Selected files:

Tags:

Misc Example