我的文件包中有json文件。我想将文件复制到文档目录。
var path = RNFS.DocumentDirectoryPath + '/data.json';
RNFS.copyFile(`${RNFS.MainBundlePath}/assests/resource/data.json`, path)
.then(() => {
console.log('FILE COPIED');
})
.catch((err) => {
console.log(err.message);
});
The file “data.json” couldn’t be opened because there is no such file.