Is that possible to move/copy file from one sdcard folder to another folder. I tyr like below but nothing shown no error, no success.
My code is
function saveCostFiles(imageData,fileName,directory){
//alert(imageData);
//alert(directory);
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function gotFile(fileSystem) {
alert(fileSystem);
fileSystem.root.getDirectory(directory, {create: true}, function fileSystemSuccess(fileSystem){
alert(fileSystem);
fileSystem.getFile("dummy.txt",{create: true,exclusive:false},function gotFileEntry(fileEntry){
alert("local");
var path = fileEntry.fullPath.replace("dummy.txt","");
fileEntry.remove();
var fileTransfer = new FileTransfer();
fileTransfer.download(imageData, path+""+fileName,function(theFile){
alert("File Downloaded Successfully " + theFile.toURI());
},function(error){
alert("failed");
});
},dbErrorHandler);
});
}, dbErrorHandler);
}
var directory = "sample/files/first/demo";
saveCostFiles("file:///storage/emulated/0/sample/files/second/template/"+skiTemplateFileName,randomFileName,directory);
Please kindly provide some suggestions