aboutsummaryrefslogtreecommitdiff
path: root/webAO/services/downloadFile.ts
blob: d2722493e42ace93c8780713f3fbb3b9c959dba2 (plain)
1
2
3
4
5
6
7
8
const downloadFile = (content: string, filename: string) => {
    const a = document.createElement('a');
    const file = new Blob([content], { type: 'text' });
    a.href = URL.createObjectURL(file);
    a.download = filename;
    a.click();
}
export default downloadFile