How to get a list of files selected by an a file upload input

I have a element (that allows multiple file uploads). I would like to use javascript/jquery to get a list of the files that have been selected for upload. Is this possible?

The element looks like

  • Getting images from my Parse database in javascript?
  • how to open a file from a jsp page?
  • Why “HTML <input type='file' />” has “files” property in JavaScript?
  • PHP: Loading gzipped javascript files
  • Create file from object dataURL
  • Limiting video record length for input type file on mobile devices
  • <input type="file" name="files[]" multiple/>
    

    I am receiving the files with a Play Framework (Java) controller – however that’s not really useful for the question.

  • Send file back in a readable format?
  • Jquery plugin for cross browser file upload
  • Best way to read from a big CSV file without loading everything to memory using Javascript
  • Create binary blob in JS
  • Link that opens a folder on network drive
  • How do I Validate the File Type of a File Upload?
  • One Solution collect form web for “How to get a list of files selected by an a file upload input”

    You can get the list from the input element’s “files” property. I think this link can help you. Javascript get number of files and their filenames from file input element with multiple attribute?

    Example:

    $files = $('#fileInput').files;
    for (var i=0, l=files.length; i<l; i++) {
         console.log(files[i].name);
    }