我正在使用带有文件类型限制的 ng2-file-upload 文件上传器。但是,每次我使用 Internet Explorer 11 选择 png 文件时,它都不会添加到队列中。所有其他允许的文件类型都在工作。这是带有文件选项的代码:
let uploadOptions: FileUploaderOptions;
if (navigator.userAgent.match(/Trident.*rv\:11\./)) {
uploadOptions = {
url: uploadUrl,
allowedFileType: ['xls', 'xlsx', 'doc', 'docx', 'pdf', 'gif', 'jpg', 'jpeg', 'png', 'odt', 'txt', 'ods'],
maxFileSize: 10 * 1024 * 1024
};
} else {
uploadOptions = {
url: uploadUrl,
allowedMimeType: ['application/pdf',
'application/vnd.ms-excel',
'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
'application/msword',
'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
'application/vnd.oasis.opendocument.text',
'application/vnd.oasis.opendocument.spreadsheet',
'image/gif',
'image/jpeg',
'image/png'
],
maxFileSize: 10 * 1024 * 1024
};
}
this.uploader = new FileUploader(uploadOptions);
this.uploader.onCompleteAll = () => {
this.editStateService.documentAdded('player', 'document');
this.documentListUpdated.emit();
this.uploader.clearQueue();
};
有人知道如何让这个工作吗?