I am using HTML 5 Multiple files ability to select multiple files for upload. The files come as an array of files in the $_FILES variable. I want to use jQuery to get all the names of the files listed before upload button is clicked.
<input class="pictures-upload" name="multiplePhotos[]" type="file" multiple="multiple" />
I want to append a onchange event that when a person clicks the upload files and selects multiple files, it will take names of all files and append it on the body of html. I am using
$('.upload_button').live('change', function () {
var li = $('<li />').text($(this).val()),
$('#body').append(li);
});
This takes only the last file to be selected. How do I get all the files?