C
C
claus_bor2018-06-22 10:33:26
JavaScript
claus_bor, 2018-06-22 10:33:26

How to download XLSX file in js?

Upon request, I get a response
5b2ca5e05837c659304041.png
and then I need to download this file as .xlsx. How can I convert and download a file?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Arman, 2018-06-22
@Arik

?

function download(content, contentType, fileName) {
    var link = document.createElement("a");
    link.href = window.URL.createObjectURL(new Blob([content], {type: contentType}));
    link.download = fileName;
    link.click();
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question