chrisben / imgcache.js

JS library based on the File API to cache images for offline recovery (target: cordova/phonegap & chrome)
Other
826 stars 216 forks source link

FileTransfer.download doesn't overwrite existing file on iOS (at least for me) #236

Open jaandrle opened 5 years ago

jaandrle commented 5 years ago

Hi, I'm appending an unique query string in path in my fileTransfer.download wrapper. So, if there are others with the same issue, it can be helpfull to add something like:

var ios_fix= ""; if(Helpers.isCordovaIOS()) ios_fix= "?v="+Math.random();//against iOS caching
/* ... */
      fileTransfer.download(
        img_src+ios_fix,
        filePath+ios_fix,

nearby https://github.com/chrisben/imgcache.js/blob/71fa146777c57273adba0cecf2beb2fe0a6228cd/lib/imgcache.js#L664