I have the following code line
if(!that.type.match(/text.*/))
It fail no matter what kind of a file it is.
if(that.files && that.files[0]){
var reader = new FileReader();
var output;
var textType = /text.*/;
var f = that.files[0];
// tested with .txt and .jpg.
// in both cases "!that.type.match(/text.*/)" returns true.
// What am I doing wrong?
if(!that.type.match(/text.*/)) {
var name = f.name;
var msg = "Obituary file must be a text file.<br />";
msg += "File " + name + " is not a text file.";
document.getElementById('errdisplay').innerHTML = msg;
}
}