11 lines
269 B
TypeScript
11 lines
269 B
TypeScript
|
export async function downloadBlob(blob: Blob, filename: string) {
|
||
|
const url = URL.createObjectURL(blob);
|
||
|
|
||
|
const link = document.createElement("a");
|
||
|
link.href = url;
|
||
|
link.target = "_blank";
|
||
|
link.rel = "noopener";
|
||
|
link.download = filename;
|
||
|
link.click();
|
||
|
}
|