I have a form that uploads file with ajax, the file selection event is like this:
# This JS is translated directly from coffeescript
$("input[name=dump_file]").on('change', function() {
# if not .xls do something like window.alert
# else
var dump_file;
return dump_file = this.files[0];
});
I need to check if dump_file
is in excel format (.xls or .xlsx), how to check for this.files[0]
file type on change
event?