async function saveFile(fileName, workbook) {
const xls64 = await workbook.xlsx.writeBuffer({base64: true})
const blob = new Blob([xls64], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})
const completeName = fileName + '.xlsx';
saveAs(blob, fileName)
let formData = new FormData();
formData.append('file', blob, completeName);
let xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://localhost:5050/upload/readXlsx.php", true);
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
console.log(this.responseText);
}
};
// Send request with data
xhttp.send(formData);
}
async function saveFile(fileName, workbook) {
const xls64 = await workbook.xlsx.writeBuffer({base64: true})
const blob = new Blob([xls64], {type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'})
const completeName = fileName + '.xlsx';
saveAs(blob, fileName)
let formData = new FormData();
formData.append('file', blob, completeName);
let xhttp = new XMLHttpRequest();
xhttp.open("POST", "http://localhost:5050/upload/readXlsx.php", true);
xhttp.onreadystatechange = function () {
if (this.readyState === 4 && this.status === 200) {
console.log(this.responseText);
}
};
// Send request with data
xhttp.send(formData);
}