I think this behaviour has been around for a while, and makes sense in the majority of cases. Best practice is to download to a temporary location, and then upon success move the file to its final spot.
That said, I think it'd be fine to add an option for not delete on error. On Mon, Jun 16, 2014 at 5:39 AM, Javier Puerto <jav...@apache.org> wrote: > Hi Cordova developers, > > I'm creating a system to download/update several resources from a server to > the device and I've observe a behaviour that breaks my use case. > > After fix the issue CB-6928, I'm able to download/update all the resources > without problems. My next test was to try to download the resources but > with no server response (stopped). I've found that the plugin is deleting > my target file silently because there's was an error. > > I think that the developer should be the responsible to delete or leave the > "corrupted" file because the file-transfer plugin already communicates the > error, I don't think that the hardcoded behaviour is a good solution. What > do you think? > I can open a new issue and provide the patch and test case (Android only) > > Best regards. >