1

I am developing a React Native application for learning purposes. What I am trying to do now is that I am trying to convert the file path to the URL of a file that is downloaded from the remote server. I am using react-native-fetch-blob package to download file.

This is my code

downloadFile = () => {
      RNFetchBlob.config({
        fileCache: true,
      })
      .fetch('GET', 'https://static.standard.co.uk/s3fs-public/thumbnails/image/2016/05/22/11/davidbeckham.jpg?w968', {

      })
      .then((res) => {
        this.setState({
          avatarSource: {
            uri: res.path()
          }
        })
      })
  }

res.path() value is something like this:

enter image description here

How can I convert it to a URI?

halfer
  • 19,824
  • 17
  • 99
  • 186
Wai Yan Hein
  • 13,651
  • 35
  • 180
  • 372
  • 1
    Does this answer your question? [React Native RNFetchBlob getting the URI of the file after download](https://stackoverflow.com/questions/56690156/react-native-rnfetchblob-getting-the-uri-of-the-file-after-download) – Pankti Shah Mar 14 '20 at 03:55

0 Answers0