1public downloadBlob(fileName: string, blob: Blob): void {
2 if (window.navigator.msSaveOrOpenBlob) {
3 window.navigator.msSaveBlob(blob, fileName);
4 } else {
5 const anchor = window.document.createElement('a');
6 anchor.href = window.URL.createObjectURL(blob);
7 anchor.download = fileName;
8 document.body.appendChild(anchor);
9 anchor.click();
10 document.body.removeChild(anchor);
11 window.URL.revokeObjectURL(anchor.href);
12 }
13}