xxxxxxxxxx
const input = document.createElement('input');
input.type = 'file';
input.addEventListener('change', event => {
const file = event.target.files[0];
if (file) {
const reader = new FileReader();
reader.addEventListener('load', event => {
console.log(event.target.result);
});
reader.readAsText(file);
}
});
document.body.appendChild(input);