I am using a custom onValidate method with FineUploader that is working in every browser but IE9. The method is something like this:
onValidate: function (fileOrBlobData) {
var validExtension = false;
var validExtensions = ["jpg","png"];
var fileName = fileOrBlobData.name || '';
for (i=0; i<validExtensions.length && !validExtension; i++) {
var extRegex = new RegExp('\\.' + validExtensions[i] + '$', 'i');
if (fileName.match(extRegex) != null) {
validExtension = true;
}
if (!validExtension) {
alert('Unsupported file type. Please try again.');
return false;
}
return true;
}
}
The difference is that in IE10, for example, the fileOrBlobData is an object File (seen with an alert) and in IE9 is an object HTMLInputElement.
Why this difference? How can I assure that this is going to work in IE9?
Thanks!