I need to download files from the server and get the link of these files that have been downloaded to device in purpose to update the state:
const [ fileLink, setFileLink ] = useState('');
const result = ... // get the link to file somehow
setFileLink(result);
I tried the following solutions:
- React Native Fetch Blob
rn-fetch-blob
. These is an error occurs "Null is not an object (evaluating 'RNFetchBlob.DocumentDir')". As far as i understood, rn-fetch-blob doesn't work with Expo. - Expo Filesystem
expo-file-system
. It doesn't provide to possibility to fetch files with GET method. Even if i use the link 'http://.../file.jpg' it have been downloaded to local folderFileSystem.documentDirectory
, but doesn't give a link to the file, so a cannot update the state.
Is there any solution to download files from the server and get the link to these files?