aboutsummaryrefslogtreecommitdiff
path: root/webAO/services/downloadFile.ts
blob: 5b2f2923778dbaa0e683ef7e9c3c1ac6c586db81 (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;