i'm trying to read docx file
(function(){
var serverRelativeUrlOfMyFile = "/sites/sitecollection/mysite/assets/file.docx";
var req = new XMLHttpRequest();
req.onreadystatechange=handler;
req.open("GET", serverRelativeUrlOfMyFile, true); // params: (method, url, async)
req.send();
function handler(){
if(req.readyState == 4 && req.status == 200){
// you can now access the file content via the responseText property
return req.responseText;
}
}})();
But instead of text I get symbols. I need to get only text.