问题
In my cordova(v 3.3) application i used copyTo for copy files from one directory to another directory in sdcard. Some time it is working fine some time it is not working. Here is the source i used to copy files from one dierctory to another.
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function gotFS(fileSystem) {
var root = fileSystem.root.fullPath;
console.log(skiTemplateFileName);
alert(root);
var fails = function(err) { alert(err.code);}
window.resolveLocalFileSystemURI(root+"/"+TEMPLATE_DIRECTORY+""+TemplateFileName, function(file) {
window.resolveLocalFileSystemURI(root+"/"+PDF_DIRECTORY, function(destination) {
file.copyTo(destination,randomFileName);
alert("File Download Successfully");
},fails)
},fails);
}, function fail(e){
});
when copy files first time only shows the file download success. For next time it shows only root alert
Note : This issue occurs in samsung tab 4(v4.4.2) devices working well in nexus 7.
Please guide to solve this issue.
来源:https://stackoverflow.com/questions/27455884/file-copyto-not-working-in-cordova