title: Upload React-Native imagePicker with axios on Cloudinary
body: <p>I try to upload some image from the camera gallery on localhost and prod environnement. My code works with a valid url like : <a href="https://res.cloudinary.com/dtdiwoz7o/image/upload/v1586706052/cn-2016-sashaonyshchenko-1920x1920-1510074905_dyfldk.jpg" rel="nofollow noreferrer">https://res.cloudinary.com/dtdiwoz7o/image/upload/v1586706052/cn-2016-sashaonyshchenko-1920x1920-1510074905_dyfldk.jpg</a>
  But when I pass the image file path, it's return an 400 error.
  Here is my code with some log :</p>
  
  <pre><code>  _avatarClicked = () =&gt; {
  const options = {
    title: 'Select Photo',
    storageOptions: {
      skipBackup: true,
      path: 'images',
    },
  };
  ImagePicker.showImagePicker(options, (response) =&gt; {
    if (response.didCancel) {
      return
    }
    else if (response.error) {
      return
    }
    else {
  
      let data = {
        file: response.uri,
        upload_preset: "my_preset_name",
      }
  
      axios.post("https://api.cloudinary.com/v1_1/my_cloud_name/image/upload", data)
        .then(res =&gt; console.log(res))
        .catch(err =&gt; console.log(err))
  
    }
  })
  </code></pre>
  
  <p>}</p>
  
  <p>log of my repsponse.uri : 
  (file:///Users/clement/Library/Developer/CoreSimulator/Devices/62E85527-A2AC-46CD-B517-E6039F99E056/data/Containers/Data/Application/E218E950-3A1C-40EB-8289-3837EC89FBBB/Documents/images/46674162-E32B-4302-B28A-5EF9150206D0.jpg)</p>
  
  <p>I tried to replace in data file this by this 'const source' but it doesn't work : </p>
  
  <pre><code>     const source = {
        uri: response.uri,
        type: response.type,
        name: response.fileName,
      }
  </code></pre>
  
  <p>I saw and test this on the react-native)image-picker documentation but I've got the same 400 error...</p>
  
  <pre><code> // const source = { uri: 'data:image/jpeg;base64,' + response.data };
  </code></pre>
  
  <p>I also try to Base64.encode(response.url) or Base64.encodeURI(response.url)</p>
  
  <p>Please, can you help me ?
  And sorry for my bad english</p>
  
  <p>"react-native": "~0.61.4",
   "react-native-image-picker": "^2.3.1",</p>
  
  <p>///////////////////////////</p>
  
  <p>I found the solution : </p>
  
  <pre><code>  let data = {
    file: 'data:image/jpg;base64,' + response.data,
    upload_preset: "my_preset_name",
  }
  
  axios.post("https://api.cloudinary.com/v1_1/my_cloud_name/image/upload/", data)
    .then(res =&gt; console.log(res))
    .catch(err =&gt; console.log(err))
  </code></pre>