WARNING: sanitizing unsafe URL value cdvfile:


I’ am getting this error on android but on ios

Failed to load resource: the server responded with a status of 404 (Not Found)

config.xml has

For ionic 2 rc After a long day of searching Here comes the solution

copied here
For anyone experiencing this issue, I have ‘solved’ it by using the following:


import {DomSanitizer} from ‘@angular/platform-browser’;

constructor(private DomSanitizer: DomSanitizationService) {}

<img [src]=“DomSanitizer.bypassSecurityTrustUrl(imgSrcProperty)”/>

Where imgSrcProperty is the offending image base64 encoded.

1 Like

constructor(private domSanitizer: DomSanitizer) {}

Also I just realized that I was using tags rather than if you use ion-img it sanitizes for you so this is not necessary.