The files property of an <input type='file'> returns an empty FileList if it's implemented, and otherwise it is not defined (i.e. it is undefined).
var support = (function(undefined) {
return $("<input type='file'>") // create test element
.get(0) // get native element
.files !== undefined; // check whether files property is not undefined
})();
It does not seem to be implementd in jQuery, but you could check yourself: http://jsfiddle.net/pimvdb/RCz3s/.
The
files
property of an<input type='file'>
returns an emptyFileList
if it's implemented, and otherwise it is not defined (i.e. it isundefined
).Another way to check is just by checking the presence of the File API types: