For
browsers which support multiple file selection[
^], you'll need to use
the files
property[
^]:
$("input[type='file']").change(function(){
if (this.files){
alert($.map(this.files, function(f){ return f.name; }).join("\n"));
}
else {
alert(this.value);
}
});
In supported browsers, each item in the
files
array is a
File[
^] object, which has other useful properties you might want to look at.