title: RNFetchBlob is not working to upload image
body: <p>I am trying to make a upload function for my Firebase Cloud Storage. I am using RNFetchBlob, along with react-native-image-picker. I can select photos, but it will not upload. All other Firebase functions works great and it is installed through React-Native-Firebase...</p>
  
  <p>Nothing seems to happen after 'fs.readFile'.</p>
  
  <pre><code>import React, { Component } from 'react'
  import {
    StyleSheet,
    Text,
    View,
    TouchableOpacity,
    Platform,
    Image,
    ActivityIndicator
  } from 'react-native'
  import ImagePicker from 'react-native-image-picker'
  import RNFetchBlob from 'rn-fetch-blob'
  import firebase from 'react-native-firebase';
  
  
  const storage = firebase.storage()
  
  // Prepare Blob support
  const Blob = RNFetchBlob.polyfill.Blob
  const fs = RNFetchBlob.fs
  window.XMLHttpRequest = RNFetchBlob.polyfill.XMLHttpRequest
  window.Blob = Blob
  
  const uploadImage = (uri, mime = 'application/octet-stream') =&gt; {
    return new Promise((resolve, reject) =&gt; {
      const uploadUri = Platform.OS === 'ios' ? uri.replace('file://', '') : uri
      const sessionId = new Date().getTime()
      let uploadBlob = null
      const imageRef = storage.ref('images').child('${sessionId}')
  
      fs.readFile(uploadUri, 'base64')
        .then((data) =&gt; {
          return Blob.build(data, { type: '${mime};BASE64' })
  
        })
        .then((blob) =&gt; {
          uploadBlob = blob
          return imageRef.put(blob, { contentType: mime })
  
        })
        .then(() =&gt; {
          uploadBlob.close()
          return imageRef.getDownloadURL()
        })
        .then((url) =&gt; {
          resolve(url)
        })
        .catch((error) =&gt; {
          reject(error)
      })
    })
  }
  
  
  class Demo extends Component {
    constructor(props) {
      super(props)
  
      this.state = {}
    }
  
    _pickImage() {
      this.setState({ uploadURL: '' })
  
      ImagePicker.launchImageLibrary({}, response  =&gt; {
        uploadImage(response.uri)
          .then(url =&gt; this.setState({ uploadURL: url }))
          .catch(error =&gt; console.log(error))
      })
    }
  
    render() {
      return (
        &lt;View style={ styles.container }&gt;
          {
            (() =&gt; {
              switch (this.state.uploadURL) {
                case null:
                  return null
                case '':
                  return &lt;ActivityIndicator /&gt;
                default:
                  return (
                    &lt;View&gt;
                      &lt;Image
                        source={{ uri: this.state.uploadURL }}
                        style={ styles.image }
                      /&gt;
                      &lt;Text&gt;{ this.state.uploadURL } {this.state.uploadURL}&lt;/Text&gt;
                    &lt;/View&gt;
                  )
              }
            })()
          }
          &lt;TouchableOpacity onPress={ () =&gt; this._pickImage() }&gt;
            &lt;Text style={ styles.upload }&gt;
              Upload
            &lt;/Text&gt;
          &lt;/TouchableOpacity&gt;
        &lt;/View&gt;
      )
    }
  }
  
  const styles = StyleSheet.create({
    container: {
      flex: 1,
      justifyContent: 'center',
      alignItems: 'center',
      backgroundColor: '#F5FCFF',
    },
    image: {
      height: 200,
      resizeMode: 'contain',
    },
    upload: {
      textAlign: 'center',
      color: '#333333',
      padding: 10,
      marginBottom: 5,
      borderWidth: 1,
      borderColor: 'gray'
    },
  })
  
  export default Demo
  </code></pre>
  
  <p>I get this error in my console when selecting a photo:</p>
  
  <blockquote>
    <p>filePath.replace is not a function. (In 'filePath.replace('file://',
    '')', 'filePath.replace' is undefined)]</p>
  </blockquote>