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);
};
}
阅读此FileReader并尝试此功能:
最诚挚的问候!