Closed consciousnessdev closed 2 years ago
Solved.
Caused by File Object must Converted to Binary String, then set XLSX.read type to binary
@consciousnessdev How did you convert your file to a binary string? I am having the same issue.
@consciousnessdev How did you convert your file to a binary string? I am having the same issue. With this Code @robhoff-laerdal
const fileObjectToBinary = fileObj => new Promise((resolve, reject) => { const reader = new FileReader(); reader.readAsBinaryString(fileObj); reader.onload = () => resolve(reader.result); reader.onerror = error => reject(error); });
Hope its help you :)
I have problem when run XLSX.read its always return sheet name as Sheet1, even though the sheet name has been changed to 'data',
Maybe can help with below clues:
const workbook = XLSX.read(convertFileToBase64, { type: 'base64' });