document.addEventListener(\'deviceready\', onDeviceReady, false);
function onDeviceReady() {
//request the persistent file system
window.requestFileSystem(Local
Try like this
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function gotFS(fileSystem) {
fileSystem.root.getDirectory("your dir", {create: true}, function fileSystemSuccess(fileSystem){
fileSystem.getFile("dummy.txt",{create: true,exclusive:false},function gotFileEntry(fileEntry){
var path = fileEntry.fullPath.replace("dummy.txt","");
fileEntry.remove();
var fileTransfer = new FileTransfer();
fileTransfer.download(FILE_DOWNLOAD_URL, path+""+your -savedName,function(theFile){
alert("File Downloaded Successfully " + theFile.toURI());
},function(error){
alert("File Transfer failed" + error.message);
});
},fail);
});
}, fail);