【发布时间】:2020-12-01 08:32:21
【问题描述】:
这适用于 chrome 和 firefox,但我在 IE 中需要它,我不知道 如何使它工作。 Internet Explorer 控制台显示“拒绝访问”
descargarPlantilla() {
this.cargaMasivaService.generarCSVPLD().subscribe(
data => {
const blob = new Blob([data._body], { type: 'application/octet-stream' });
const contentDisposition = data.headers.get('content-disposition');
if (contentDisposition && contentDisposition.indexOf('attachment') !== -1) {
const filenameRegex = /filename[^;=\n]*=((['"]).*?\2|[^;\n]*)/;
const matches = filenameRegex.exec(contentDisposition);
}
this.modalMensajeService.modalExito('El Documento se ha descargado exitosamente');
},
error => {
this.modalMensajeService.modalError(error);
}
);
}
【问题讨论】:
标签: angular google-chrome internet-explorer firefox blob