Indeed, this is an unexpected behavior that I was able to reproduce. I found an item
logged in Cordova's bug tracker about the the same case and would recommend voting for it. FileTransfer plugin
is mostly developed by Cordova's team and its community contribution so I can only provide you workarounds.
As soon as they implement a fix in any plugin's version you should be able to take advantage of it by importing
this particular version in your app and disable the integrated one.
Here are a few workarounds that you can try until a fix arrives:
- Call the download method only when the app has internet access. You can check that using the Cordova events.
- Change file name or destination every time.
- Once downloaded move the file.
- I was able to lock the file (in my case image) by using it as a source for a HTML img tag. This prevents its deletion.
- Store the image in the localStorage
Please let me know if I can be of further assistance.
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.