简体   繁体   中英

how to upload .ply file using ng2-file-upload in angular

i am trying to upload various file using ng2-file-upload and here i am able to upload all the file types like png,jpg etc except .ply file so how can i upload the file with that extension

below is my code

  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);
      }




    }


  }

below is my stackblitz url : https://stackblitz.com/edit/angular-r6cbrj

ply is not a recognized MIME type by ng2-file-upload . You can find all the supported MIME types in the source code here:

https://github.com/valor-software/ng2-file-upload/blob/development/src/file-upload/file-type.class.ts

as you can see, the content type is set to application for non-listed file extensions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM