
Question:
Im using the camera to take an image and preview it. It needs to be sent to a server so Im using the destination type of 'FILE_URI'. It works when I run it on android, but Im getting this error running it on ios 10.3.1
Not allowed to load local resource : file:///var/mobile/Containers/Data/Application/2CE518F3-4F4E-42A9-94E1-DC06D01250C7/tmp/cdv_photo_001.jpg
I am not running it with the -lc tag. The encoding type is JPEG
Answer1:I was facing same problem and I realized that in iOS camera plugin returns source with protocol for new captures but when using it in your HTML to set the source of an element like img or video you need to remove protocol... So I did :
if (isIos()) {
itemSrc = itemSrc.replace(/^file:\/\//, '');
}
If you want to move capture to somewhere else restore protocol or make a copy beforehand or whatever
Hope it helps
Answer2:I was running the app in livereload mode and facing the same problem and I tried <a href="https://stackoverflow.com/questions/37090706/ionic-cordova-fileupload-error-not-allowed-to-load-local-resource" rel="nofollow">this answer</a>, changing from livereload to normal mode solved the problem.
It should help you as helped me, at least for now.
Answer3:use this path = normalizeURL(path);
and also read more about <a href="https://ionicframework.com/docs/wkwebview/" rel="nofollow">WKWebView</a>