IOS Cordova installed local file as img src
I am using Plugo File Plugin to get a file to disk. I want to display this file in my application, so I have javascript:
image.src = imageFile.localURL;
However, I am getting an error when the url is not supported. I think this is because of the cdvfile: // prefix?
I also tried using the file entry:
imageFileEntry.nativeURL
imageFileEntry.toInternalURL()
But no luck. I either get an error when loading a local resource or that the url is not supported.
While searching for this problem, there are many questions, but no one has been able to solve my problem. Am I missing a step? Now I am doing:
- Get FileEntry
- Create Image Object
- Set image source to file path from file entry
Do I need to set up any server on the device to host the file? Use a different plugin? What can I lose?
Relevant details of my setup:
- My app is using WK โโWebview
- I am loading a web page into an application that downloads and runs the code to display an image from a device.
- The device runs iOS 10.2
+3
source to share