resp.blob().then(blob => { if (window.navigator && window.navigator.msSaveOrOpenBlob) { window.navigator.msSaveOrOpenBlob(blob, fileName); } const url = window.URL.createObjectURL(blob); const anchor = document.createElement('a'); anchor.download = fileName; anchor.href = url; anchor.click(); setTimeout(() => { window.URL.revokeObjectURL(url); anchor.remove(); }, 500); }