rn-fetch-blob: File download: Unable to locate file after download
RNFetchBlob
.config({
fileCache : true,
// android only options, these options be a no-op on IOS
})
.fetch('GET', 'http://117.12.209.52/jdrr_cert_gen/images/image_283.jpg', {
//some headers ..
})
.then((res) => {
// the path should be dirs.DocumentDir + 'path-to-file.anything'
console.log('The file saved to ', res.path())
})
console.log('The file saved to ', res.path()) returns /data/user/0/com.myapp/files/RNFetchBlobTmp_x34fi32dgqgwbthcfrdc8e
I have also used download manager and specific path but unable to loacte file. When i am using download manager, I also get a notification but no image.
React native : 0.56 Mutliple Physical devices used
About this issue
- Original URL
- State: open
- Created 6 years ago
- Comments: 15
Links to this issue
Commits related to this issue
- Merge pull request #212 from nnrohu/patch-1 Update build.gradle — committed to BeApp/rn-fetch-blob by RonRadtke a year ago
I’m facing the same issue but only in iOS device using
RNFetchBlob.fs.dirs.DocumentDiras path. The fetch response comes with the correct path but after download i got no file.EDIT: i’ve solved this by using
WRITE_EXTERNAL_STORAGEpermission on Android. And using this keys in info.plist for iOS:As described here, to enable file sharing in the app Document folder.
I was faced same issue, but it solved. Simple solution that worked was
Make sure to check you have the write external storage permission for android, I left this out and everything appeared to work correctly accept file wouldn’t show up