cordova - phonegap filesystem url - usage in html image tag -


I recently migrated to PhoneGrap 3.2 and changed my file transfer code to use URL rather than fullPath Documents should be done. The path comes back like cdvfile: // localhost / ...

I store this path when the file is downloaded from the server for the first time and it can be used later The image loads fine when the entire html page is loaded for the first time, but later the image fails to load the image.

I'm finally working on it. You will need to call getFile to get a file entry and then use the url in the image source. I create an image tag with some default image in the following format -

  & lt; Img src = "default.png? Genuine game" />  

Once this is done, I register a script to go through all such images and then do a GetFile and I change the image source and it works fine. Does. I am not sure of the logic why it is necessary. I went wrong with this fix.

Another issue I found was that the file entry. Url () path does not work on iOS, I had to use the fullpath for the iOS and to URL for Android.


Comments