I have been attempting to transform an uploaded XLSX file into JSON format using https://github.com/bgrins/filereader.js for handling the upload process and https://github.com/SheetJS for the actual conversion of the file. Below is the code I am currently using:
var opts = {
dragClass : 'drag',
on: {
load: function(e, file) {
var result = e.target.result;
var xlsread = XLSX.read(result, {type: 'binary'});
var xlsjson = XLSX.utils.sheet_to_json(xlsread.Sheets.Sheet1);
console.log(xlsread,xlsjson);
}
}
};
$("#file-input, #dropzone").fileReaderJS(opts);
Despite this code, all I seem to receive is an empty array in return.
Does anyone have any suggestions or tips on how to solve this issue?