Open puzpuz opened 7 years ago
You need to send full path with file name:
RNFS.copyFileAssets('stickers/test.txt', RNFS.DocumentDirectoryPath + 'test.txt') .then((result) => console.log(result)) .catch((error) => console.log(error));
Having same issue.
@SoundBlaster clarification is correct but there is still an issue with the source path (that being android assets
folder)
@puzpuz Have you found any workaround?
@benvium any idea what could be wrong?
Hi @aschenkel ...
In my project, since my asset's file is a zip folder, I am using another library (react-native-zip-archive) to unzip the file and put inside android's document directory file. This is not exactly a solution, but since my file is consist of a lot of images, zipping it would be the best solution for me :)
Facing same issue, I need to open a pdf file using external pdf opener [Error: Asset '/data/user/0/com.fleapo.jharkhandupdate/files/JharkhandUpdate/JharkhandUpdateDocuments/JharkhandUpdate1633700791252.pdf' could not be opened] This is the error that I am getting.
Also getting this error
Hey Guys, Any updates on this issue ?
RN: 0.43.3 RNFS: 2.5.1
I am trying to copy file from android assets folder into android document directory path.
RNFS.existsAssets('stickers/test.txt').then((result) => console.log(result));
. The result istrue
RNFS.copyFileAssets('stickers/test.txt', RNFS.DocumentDirectoryPath) .then((result) => console.log(result)) .catch((error) => console.log(error));
. It showsExpected behavior: Since existsAssets returned TRUE, the file should be copied successfully into new directory instead of returning file not found