I am working on an app that saves some images from a server in local persistent storage for offline use. To get the image url after saving it, I use FileEntry. toURL().
fs.root.getFile(path, { create: false, exclusive: false }, function (fileEntry) {
resolve(fileEntry.toURL());
}, (e)=>{
console.error(e);
});
This works correctly on Android and on iOS simulator, but not on the iOS device, where I get this error:
Failed to load resource: The operation couldn’t be completed. Operation not permitted
The file url is like this: file:///var/mobile/Containers/Data/Application/0000000-0000-0000-0000-000000000/Documents/1.png
I know that I could read the file to a blob and use it, but this can't work if I download an HTML file with other references inside.
Can anyone point me to a solution?