问题
In Angular, I'm converting blob to base64 FileReader. But I want to remove the data:application/octet-stream;base64,
at the start.
getRecordedAudio() {
if (this.recordedAudio) {
let fileReader = new FileReader();
fileReader.onloadend = function() {
let base64data = fileReader.result;
//base64data = base64data.split(',')[1]; ---> How can this be done?
console.log('base64data-', base64data);
};
fileReader.readAsDataURL(this.recordedAudio);
}
}
How can I do this?
I'm getting error:
Property 'split' does not exist on type 'ArrayBuffer'.
来源:https://stackoverflow.com/questions/58473636/angular-filereader-base64-remove-preceding-data