I have a working code to convert my File object to base64:
let reader = new FileReader(); reader.readAsDataURL(myFile); reader.onload = () => {