Dan*_*C12 11 javascript filelist heif heic
我正在使用文件选择输入来上传多个文件。用户选择文件后,我会循环排序FileList
以检查是否有任何 HEIC/HEIF 文件,以便显示错误消息。
const fileSelect = document.createElement("input");
fileSelect.setAttribute("type", "file");
fileSelect.setAttribute("multiple", "multiple");
fileSelect.click();
Run Code Online (Sandbox Code Playgroud)
if(!this.vm.acceptedTypes.includes(file.type)) {
console.log(file);
this._$inj.globalFac.showAlert(file.name, `Error: File type ${file.type} is not supported.`);
continue;
}
Run Code Online (Sandbox Code Playgroud)
但是,当用户上传 HEIC/HEIF 文件时,该type
属性为空。为什么?
归档时间: |
|
查看次数: |
1210 次 |
最近记录: |