I am trying to display image while editing imformation but could not do it. I am getting below response from server.
ÿØÿàJFIFÿÛC
%# , #&')*)-0-(0%()(ÿÛC
I want to convert this response into Base64 so that I can handle but dont know how to convert it.
Can anyone tell me how to do this?
I am trying to do this but does not work..
response => {
console.log('Media',response)
let base64Data: string;
let reader = new FileReader();
reader.readAsDataURL(response);
reader.onloadend = () => {
base64Data = reader.result;
this.previewURL = this.sanitizer.bypassSecurityTrustUrl(base64Data);
};