function readFile(binaryFile) {
let reader = new FileReader();
reader.readAsArrayBuffer(binaryFile);
// in success case, do something with result
reader.onload = function() {
console.log(reader.result);
};
// in error case, do something with result
reader.onerror = function() {
console.log(reader.error);
};
}
Read this FileReader and try this function:
with best regards!