I am using the below code to read a Word document file. This code worked fine when I used it to read a text file
$('#xfilex').live('change', function() {
var file = document.getElementById('xfilex').files[0];
if(file) {
var reader;
reader = new FileReader();
reader.readAsText(file, "UTF-8");
reader.onload = loaded;
}
});
function loaded(evt) {
var fileString = evt.target.result;
var str = fileString;
alert(str);
}
But this code is unable to read .docx/.doc file. Please help me correct the code.