I have been trying to copy/move files from the tmp directory to either the Documents or the Library directory in my app on iOS.
Both fail miserably giving me an error. (error code 6 NO_MODIFICATION_ALLOWED_ERR).
https://github.com/apache/cordova-plugin-file/blob/master/doc/index.md
According to the documentation here I should theoretically be able to transform the paths into a directory object and then be able to move/copy files there. Documents and Library have r/w access. The documentation doesn't say anything about requesting a FileSystem first and all that. So I am a bit puzzled about what to do to actually be able to copy files into persistent storage.
window.resolveLocalFileSystemURL(fileURL, function(file){
console.log('Moving File');
file.moveTo(window.MainApp.FolderObject, newName, window.MainApp.SuccessHandler, window.MainApp.ErrorHandler);
}, window.MainApp.ErrorHandler);
The FolderObject is created like this:
window.resolveLocalFileSystemURL(window.MainApp.FileFolder,function(dir){
window.MainApp.FolderObject = dir;
}, window.MainApp.ErrorHandler);
And the MainApp.FileFolder points to: file:////Library/
Also the directories referred to in the documentation do not resolve when testing it through the console. That's the reason why copying files to the supposedly accessible Documents folder fails.
Please help, this is extremely frustrating and confusing.