title: Image upload with axios react native android
body: <p>I am trying to upload image to an API the iOS version is working good but there is problem in android, My code is bellow.</p>
  <pre><code>const uploadUri =
      Platform.OS === 'ios'
        ? uploadImageFile.replace('file:', '')
        : uploadImageFile;
    // console.log(uploadUri);
    const data = new FormData();
    data.append('file', {
      uri: uploadUri,
      name: 'file',
      type: 'image/jpg',
    });
    Axios.post(`${API.BASE_URL}/user/image`, data, {
      headers: {
        Authorization: token,
        'Content-Type': 'multipart/form-data',
      },
    })
      .then((res) =&gt; {
        setActivity(false);
        setIsImageEdit(false);
        console.log('success');
      })
      .catch((error) =&gt; {
        setActivity(false);
        if (error.response) {
          console.log(error.response.data);
          console.log(error.response.status);
          console.log(error.response.headers);
        } else if (error.request) {
          console.log(error.request);
        } else {
          console.log('Error', error.message);
        }
        setIsImageEdit(false);
      });
  </code></pre>
  <p>The error response I get is</p>
  <pre><code>{&quot;DONE&quot;: 4, &quot;HEADERS_RECEIVED&quot;: 2, &quot;LOADING&quot;: 3, &quot;OPENED&quot;: 1, &quot;UNSENT&quot;: 0, &quot;_aborted&quot;: false, &quot;_cachedResponse&quot;: undefined, &quot;_hasError&quot;: true, &quot;_headers&quot;: {&quot;accept&quot;: &quot;application/json, text/plain, */*&quot;, &quot;authorization&quot;: &quot;7aeb23f62bd748c39c9e8652eb1056e2&quot;}, &quot;_incrementalEvents&quot;: false, &quot;_lowerCaseResponseHeaders&quot;: {}, &quot;_method&quot;: &quot;POST&quot;, &quot;_perfKey&quot;: &quot;network_XMLHttpRequest_https://capi-test.beebl.io/user/image&quot;, &quot;_requestId&quot;: null, &quot;_response&quot;: &quot;Could not retrieve file for uri /storage/emulated/0/Pictures/images/image-448777a5-1734-41f4-857e-a99d5239c279.jpg&quot;, &quot;_responseType&quot;: &quot;&quot;, &quot;_sent&quot;: true, &quot;_subscriptions&quot;: [], &quot;_timedOut&quot;: false, &quot;_trackingName&quot;: &quot;unknown&quot;, &quot;_url&quot;: &quot;https://capi-test.beebl.io/user/image&quot;, &quot;readyState&quot;: 4, &quot;responseHeaders&quot;: undefined, &quot;status&quot;: 0, &quot;timeout&quot;: 0, &quot;upload&quot;: {}, &quot;withCredentials&quot;: true}
  </code></pre>
  <p>&quot;_response&quot;: &quot;Could not retrieve file for uri /storage/emulated/0/Pictures/images/image-448777a5-1734-41f4-857e-a99d5239c279.jpg&quot;</p>