let inp = document.createElement('input') inp.setAttribute('type','file') document.body.appendChild(inp) inp.oninput = (e)=> { let files = e.target.files let f = files[0]; let reader = newFileReader(); reader.onload = function(e) { var data = newUint8Array(e.target.result); var workbook = XLSX.read(data, {type: 'array'}); console.log(workbook,'workbook') }; reader.readAsArrayBuffer(f); }