I have been successful in uploading a file using the FileTransfer.upload() command to upload a file to a server. I have not been able to get the download command to work. Here is my code:
Code:
var fileTransfer = new FileTransfer(),
uri = encodeURI('myURI');
fileTransfer.download(uri, LocalFileSystem.PERSISTENT,
function(entry) {
console.log("download complete: " + entry.fullPath);
},
function(error) {
console.log("download error source " + error.source);
console.log("download error target " + error.target);
console.log("upload error code" + error.code);
}
);
The example on the Apache Cordova website seems very straight forward, but I seem to be missing something obvious.