I'm trying to read a binary (digital biometric) file that the user selects himself. But it is not returning anything.
What's wrong?
Follow the code below:
var fileInput = document.getElementById('fileInput');
var file = fileInput.files[0];
var reader = new FileReader();
var campo = "";
reader.onload = function(e) {
campo = reader.result;
}
reader.readAsArrayBuffer(file);
document.getElementById('template').value = campo;
alert("CAMPO TAMANHO --> " + campo.length);
}