I need some help returning the "bytes" variable from this function below to be used as input in another function.
function openfile() {
var input = document.getElementById("files").files;
var fileData = new Blob([input[0]]);
var reader = new FileReader();
reader.readAsArrayBuffer(fileData);
reader.onload = function(){
var arrayBuffer = reader.result
var bytes = new Uint8Array(arrayBuffer);
console.log(bytes);
}
I'd like to get the return of the above function and use the array of bytes as input parameter in another function.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…