itinance / itinance/react-native-fs
Asset file download to device
- Dominant language
- C++
- Stars
- 5k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
I need to download file which is in application to iOS device.
which is located like
```
- appfolder
-src
-assets
-icons
-bootsplash.png
```
I implemented code like below but the source path is not found by copyFile() function
```
sourcepath='src/assets/icons/bootsplash.png';
const destinationPath = `${RNFS.DocumentDirectoryPath}/bootsplash.png`;
RNFS.copyFile(sourcepath, destinationPath, 10, 10)
.then(() => {
console.log('Asset copied successfully to:', destinationPath);
})
.catch(error => {
console.error('Error copying asset:', error);
});
```
When I try sourcepath with 'Users/m*****/Documents/reactProjs/MyApplication/src/assets/icons/bootsplash.png' its working but I want to set this path dynamically. How can we get application path dynamically with code or any other solution?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.