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

Commits related to this issue

Most upvoted comments

I’m facing the same issue but only in iOS device using RNFetchBlob.fs.dirs.DocumentDir as 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_STORAGE permission on Android. And using this keys in info.plist for iOS:

<key> UIFileSharingEnabled</key>
<true/>
<key>LSSupportsOpeningDocumentsInPlace</key>
<true/>

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

  1. Open App Info from mobile
  2. In Permissions -> Please make sure Storage is ticked

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