I can download files with phonegap api. (I use cordova 2.9.1) But only if I know the url, for example: http://domain.com/url/to/img/moo.png.
But in my server I want to read the binary data of the file and send the binary string to the phonegap app.
Is this possible to achieve this???
Here is the code: var fileTransfer = new FileTransfer(); // var uri = encodeURI("http://zielekols.com/Bilder/logo.png");
var uri = encodeURI('url/to/get');
fileTransfer.download(
uri,
'/storage/emulated/0/moo.pdf',
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);
},
false
);