title: How remove invalid or specific files from fileupload in prime ng p-fileUpload?
body: <p>I have used file upload for uploading files and I want to validate the files when I select one of them and remove it if that is not a valid file. </p>
  
  <p>.html</p>
  
  <pre><code>&lt;p-fileUpload #fileUpload  name="datafiles"
             [accept]=FileExtentionValue
             [url]="FileUploadUrl"
             [showUploadButton]="isUploadEnable"
             [disabled]="diableFileupload"
              (onUpload)="onUpload($event)"
              (onSelect)="validateFile($event)"
             multiple="multiple"&gt;
            &lt;/p-fileUpload&gt;
  </code></pre>
  
  <p>.ts </p>
  
  <pre><code>onUpload(event) {
          for (let file of event.files) {
            this.uploadedFiles.push(file);
          }
          this.messageService.add({ severity: 'info', summary: 'File Uploaded', detail: '' });
        }
  </code></pre>
  
  <p>validate filles name </p>
  
  <pre><code>     validateFile(event) {
      let tempFiles: any = [];
      var FileNmaeMust: any;
      for (let file of event.files) {
        tempFiles.push(file.name);
      }
      for (let i = 0; i &lt; tempFiles.length; i++) {
        let count = 1;
        for (let j = 0; j &lt; this.ClientDataFileTypeValue.length; j++) {
          FileNmaeMust = "";
          if (this.ClientDataFileTypeValue[j] == "Order") {
            FileNmaeMust = this.MPID + "_ORDER_";
          }
          /*** Validate File  */
          var templen = FileNmaeMust + "YYYYMMDD.psv";
          if (tempFiles[i].includes((FileNmaeMust).toLocaleUpperCase()) &amp;&amp; tempFiles[i].length == templen.length) {
            this.isUploadEnable = true;
            break;
          }
          if (count == this.ClientDataFileTypeValue.length) {
            this.isUploadEnable = false;
            this.messageService.add({ severity: 'error', summary: 'Files', detail: 'Please select correct file ' + tempFiles[i] });
          }
          count++;
        }
      }
    }
  </code></pre>