3

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

Biraj Zalavadia
  • 28,348
  • 10
  • 61
  • 77
Vini
  • 967
  • 1
  • 15
  • 33
  • "copy a directory from one location to another location in sdcard " did you mean it? – Tanim reja May 14 '14 at 04:12
  • @Tanimreja yes...i got success now but one more problem is please see this occured..http://stackoverflow.com/questions/23534963/upload-multiple-files-show-error-code-3 – Vini May 14 '14 at 04:17
  • yap i am hear ..@Ela – Tanim reja May 14 '14 at 04:44
  • @Tanimreja any idea about this one http://stackoverflow.com/questions/23534963/upload-multiple-files-show-error-code-3# – Vini May 14 '14 at 04:47

0 Answers0