Vote count:
0
I want to download image file from the server to my local storage in some specific folder. I try that with using Phonegap and it works there with Phonegap using eclipse tool. I tried that same code in IntelXDK tool as IntelXDK support cordova. The code as follow
function downloadFile(destPath){
var fileTransfer = new FileTransfer();
var uri = encodeURI("imagepath of server");
fileTransfer.download(
uri,
destPath,
function(entry) {
alert("download complete: " + entry.fullPath);
},
function(error) {
alert("download error source " + error.source);
alert("download error target " + error.target);
alert("upload error code" + error.code);
});
}
and code to get local storage folder path
window.requestFileSystem = window.requestFileSystem || window.webkitRequestFileSystem;
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, gotFS, fail);
function fail() {
alert("failed to get filesystem");
}
function gotFS(fileSystem) {
alert("got filesystem");
alert(fileSystem.root.fullPath);
}
But i am not getting any from fail() or gotFS() functions
Is there any permission which i am missing to add here. Please provide your comments. Thanks in advanced...
asked 31 secs ago
how to access device local storage folder path in Intel XDK
Aucun commentaire:
Enregistrer un commentaire