Skip to content

Instantly share code, notes, and snippets.

@mayroncachina
Last active August 29, 2015 14:26
Show Gist options
  • Save mayroncachina/325de8a6afff69f1dba6 to your computer and use it in GitHub Desktop.
Save mayroncachina/325de8a6afff69f1dba6 to your computer and use it in GitHub Desktop.
Phonegap Download API
var fileTransfer = new FileTransfer();
var uri = encodeURI("http://some.server.com/download.php");
fileTransfer.download(
uri,
fileURL,
function(entry) {
console.log("download complete: " + entry.toURL());
},
function(error) {
console.log("download error source " + error.source);
console.log("download error target " + error.target);
console.log("upload error code" + error.code);
},
false,
{
headers: {
}
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment