mah*_*nim 0 javascript internet-explorer ng2-file-upload angular
我正在使用 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();
};Run Code Online (Sandbox Code Playgroud)
有人知道如何让它工作吗?
| 归档时间: |
|
| 查看次数: |
3501 次 |
| 最近记录: |