title: Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'
body: <p>I am trying to read a user uploaded xml file in angular. Below is my code:</p>
  
  <p>Component.ts:</p>
  
  <pre><code>convertFileToString(event){
      this.uploadXML=event.target.files[0];
      let fileReader = new FileReader();
      fileReader.onload = (event) =&gt;{this.finalUploadedXML=fileReader.result as String}
      fileReader.readAsText(this.uploadXML);
      console.log("The contents are:")
      console.log(this.finalUploadedXML);
    }
  </code></pre>
  
  <p>index.html</p>
  
  <pre><code>&lt;input type="file" id="uploadInput" (change)="convertFileToString($event)" hidden&gt;
  </code></pre>
  
  <p>But when i run this code, it gives me the following error:</p>
  
  <pre><code>Failed to execute 'readAsText' on 'FileReader': parameter 1 is not of type 'Blob'
  </code></pre>
  
  <p>I also modified the <code>readAsText(this.uploadXML)</code> to <code>readAsText(this.uploadXML.asInstanceOf[Blob])</code> but it seems that <code>asInstanceOf</code> is not a known property of File type. So i tried changing the type of <code>uploadXML</code> from <code>File</code> to <code>Blob</code> and the error still persists. What should i do?</p>