Upload a picture to base64, and report an error.

: ERROR TypeError: Failed to execute "readAsDataURL" on" FileReader": parameter 1 is not of type "Blob".
this is written in ionic

\\xx.html
<input type="file" (change)="selectImage(this.files)" accept="image/jpeg,image/png,image/jpg">
\\xx.ts
selectImage(file){
      var reader = new FileReader();
      reader.onload = function(file){
        // console.log(evt.currentTarget)
      }
      reader.readAsDataURL(file);
      console.log(reader.readAsDataURL(file));  
  }

Mar.11,2021

this.files is a class array, take the first reader.readAsDataURL (file [0]);


selectImage(event){
      let reader = new FileReader();
      let file = event.target.files[0];
      reader.readAsDataURL(file);
      reader.onload = function(){
        console.log(reader.result)
      }
    }

I want to ask how I convert blob to base64. The string I got is: url ("blob: http://localhost:8080/cc116c31-f8f1-47b1-a87b-96d948253495"). Please give me your advice

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b38a86-2b97a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b38a86-2b97a.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?