Skip to content Skip to sidebar Skip to footer

Ionic - Setting An Image Source As File_uri Produces: Not Allowed To Load Local Resource Error

I'm using Android at the moment and developing my app with Ionic. When a user takes a photo, I'm having it append to an ion-slide in a ion-slides element. However, I keep getting '

Solution 1:

It's security layer in mobile which denies to load the image from web view. You can use 'DATA_URL' which will return base64 content. you can attach to src property by appending content type and applying DomSanitizer service.

If you still want to use FILE_URI, using ionic-native/file plugin https://ionicframework.com/docs/native/file/, you can move the image in to application data directory and you can access from there.

Post a Comment for "Ionic - Setting An Image Source As File_uri Produces: Not Allowed To Load Local Resource Error"