Hi,
I am trying to implement the moveFile function from the native File class, but I can’t get it to work, saying that the moveFile function does not exist. I am probably overlooking something here, but I can’t seem to find it.
I tried to use:
cordova.file.moveFile(path, filename, newPath, newFileName)
File.moveFile(path, filename, newPath, newFileName)
(Importing the File class from ionic-native didn’t do it either)
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
console.log('file system open: ' + fs.name);
fs.moveFile(path, filename, newPath, newFileName).then(
(success) => console.log(success),
(err) => console.log(err)
);
}, console.log('filesystem not open'));
and finally
window.requestFileSystem(LocalFileSystem.PERSISTENT, 0, function(fs) {
console.log('file system open: ' + fs.name);
fs.root.moveFile(path, filename, newPath, newFileName).then(
(success) => console.log(success),
(err) => console.log(err)
);
}, console.log('filesystem not open'));
Can anyone help me out here? Thanks!