Issue
HTML code:
<img [src] = "BmdFile_strbase64" class="bmd-img"/>
component.ts code:
this.BmdFile_strbase64 = "data:image/png;base64, " + this.InfoItem["strBase64_Directory"];
I'm getting this error :
unsafe:data:image/png;base64, Qk1KXQAAAAAAADoEAAAoAAAAmAAAAJYAAA...
I decode from file extension .BMD.
How can I fix this?
Solution
I did as @Shashank Vivek said. I used sanitizer in Angular html code:
<img [src]="BmdFile_strbase64" class="bmd-img" />
component.ts code:
BmdFile_strbase64 : SafeResourceUrl;
this.BmdFile_strbase64 = this.sanitizer.bypassSecurityTrustResourceUrl("data:image/bmd;base64, " + this.NcSheetInfoItem["strBase64_Directory"] );
And BMD file is showing ok.
Answered By - dev.for.live
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.