After successfully retrieving the base64 value of my file, I noticed that along with the value, I am also getting the type of file and the type of string. However, I only require the actual value in order to send it to the backend.
Code for converting file to base64
handleUpload(e) {
var reader = new FileReader();
const file = (e.target as HTMLInputElement).files[0];
reader.readAsDataURL(file);
reader.onload = () => {
console.log(reader.result as string);
};
}
https://i.sstatic.net/Oc82s.png
I specifically need the value beginning from 'U' after the word 'base64.'