I cannot use local storage or sql as the file is 10mb.
I need to be able to download .json , .jpg and .png files to my applications folder not the sd card.
Looking through the documentation I have tried the fileTransfer download example also but get an error message of "1".
I suspect it has something to do with the filePath not being correct.
var fileTransfer = new FileTransfer();
var uri = encodeURI("http://www.mocky.io/v2/59a022952c00008d0e51d6a6"); // This is a tiny json file just as an example
console.log("download complete: " + entry.fullPath);
console.log("download error source " + error.source);
console.log("download error target " + error.target);
console.log("upload error code" + error.code);
I have read all the links in the forum relating to fileTransfer:
You're trying to download to the root directory of your device ("/"), which is outside your app's sandbox and will be guaranteed to fail.
You might try downloading to "cdvfile://localhost/persistent/somefile.json" and see if that works -- this should download the file to your application's sandbox. (Note: be careful where you store stuff on iOS, since Apple is twitchy about that. If the data is something that can always be redownloaded, store to a temporary location instead of a persistent location. cdvfile://localhost/temporary/... should work)