jQuery and input[type=file][multiple=multiple] values

html, javascript, jquery

Solution

$('.multiupload').map(function(){
  return $(this).val();
});

Update: For using `multiple` attribute for one input filed, there is `files` property you could get.

$.map($('.multiupload').get(0).files, function(file) {
  return file.name;
});

Problem

For example, there is a field: ``` <input type="file" name="files[]" multiple="multiple" class="multiupload" /> ``` How can I acces all the files list when multiple files have selected? `$('.multiupload').val()` returns only first file name. I trying to do this in Google Chrome.

Original source

Related problems