exceljs / exceljs/exceljs

trying to download the Excel file

Open
#2,313 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
15.5k
Forks
2k
PR merge metrics
No merged PRs in 30d

Description

## 💬 Questions and Help

I am trying to download the excel file. It is reading correctly without any errors but when trying to download the same file, it is giving MIME type error.

// Save the updated workbook to a Blob
const updatedFileData = await workbookJS.xlsx.writeBuffer();
const blob = new Blob([updatedFileData], { type: 'application/vnd.ms-excel' });

// Create a temporary URL for the Blob
const url = URL.createObjectURL(blob);

// Create a hidden anchor element to trigger the download
const anchor = document.createElement('a');
anchor.href = url;
anchor.download = 'example.xlsx';

// Trigger the download
anchor.click();

Can you please provide the sample code to write and download the excel file?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.