I want to read out the filenames of my multi upload form, however Javascript is just adding the first item only.
<input name="upload[]" id="upload" type="file" multiple="multiple">
$("#upload").change(function() {
$("#upload").each(function() {
$("#upload_prev").append(this.value);
});
});
Multiple file upload fields are not yet very well supported by jQuery. Your best option is to revert to native javascript to get access to the
filescollection. Try this:Example fiddle
Also, here’s a fiddle with a couple of the issues with your example fixed, such as clearing the previous list of files when re-selecting and appending the filename on a new line: http://jsfiddle.net/Vs5Hk/3/