Last active
August 4, 2022 09:05
-
-
Save rohmanhm/ab05eb68cc344e37cf51f2384d392748 to your computer and use it in GitHub Desktop.
Revisions
-
rohmanhm renamed this gist
Aug 4, 2022 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rohmanhm created this gist
Aug 4, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ export function downloadFileFromBlob(fileName: string, blob: Blob) { const url = window?.URL?.createObjectURL(blob); const link = document.createElement("a"); link.style.display = "none"; link.href = url; link.setAttribute("download", fileName); document.body.appendChild(link); link.click(); setTimeout(() => { document.body.removeChild(link); window.URL.revokeObjectURL(url); }, 200); }