我正在尝试使用 ng2-file-upload 上传各种文件,在这里我可以上传除.ply文件之外的所有文件类型,如 png、jpg 等,所以我如何上传具有该扩展名的文件
下面是我的代码
imga = "http://icons.iconarchive.com/icons/hopstarter/soft-scraps/256/Button-Upload-icon.png";
public uploader:FileUploader = new FileUploader({url: URL});
public hasBaseDropZoneOver:boolean = false;
public hasAnotherDropZoneOver:boolean = false;
public selectedFilesArray = [];
private selectedFile;
public selectFile(e: any): void {
var target = e.target || e.srcElement || e.currentTarget;
var value = target.innerHTML;
this.selectedFile = value;
this.selectAll = true;
this.selectedFilesArray = [];
this.selectedFilesArray.push(this.selectedFile);
}
public fileOverBase(e: any): void {
this.hasBaseDropZoneOver = e;
}
public selectAllFiles(e: any): void {
this.selectedFilesArray = [];
if (e.target.checked) {
this.selectAll = true;
for (var item in this.uploader.queue) {
this.selectedFilesArray.push(this.uploader.queue[item].file.name);
}
}
}
以下是我的 stackblitz 网址:https ://stackblitz.com/edit/angular-r6cbrj