Función para descargar y guardar un archivo con phonegap:
function descargarArchivo(url, achivoNombre) {
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
var imagePath = fs.root.nativeURL + achivoNombre; // full file path
var fileTransfer = new FileTransfer();
fileTransfer.download(url, imagePath, function(entry) {
console.log(entry.fullPath); // entry is fileEntry object
}, function(error) {
console.log(error);
console.log("Some error");
});
});
}
