title: upload image to S3 presigned url using react-native-image-picker and axios
body: <p>I am trying to get an presigned url image upload working correctly. Currently the upload succeeds when selecting an image from the IOS simulator, however when I actually try to view the file it seems the file is corrupted and will not open as an image. I suspect it has something to do with my FormData but not sure.</p>
  
  <pre><code>export async function receiptUpload(file) {
  
    const date = new Date();
    const headers = await getAWSHeaders();
  
    const presignUrl = await request.post(
        urls.fileUpload.presignUpload,
        {file_name: `${date.getTime()}.jpg`},
        {headers}
      )
      .then(res =&gt; res.data);
  
    const formData = new FormData();
    formData.append('file', {
      name: `${date.getTime()}.jpg`,
      uri: file.uri,
      type: file.type
    });
  
    const fileUpload = presignUrl.presignUrl &amp;&amp; await request.put(
        presignUrl.presignUrl,
        formData
      )
      .then(res =&gt; res.status === 200);
  
  }
  </code></pre>
  
  <p>I have tried from other fixes to change the file uri like so...</p>
  
  <p><code>Platform.OS === 'android' ? file.uri : file.uri.replace('file://', '');</code></p>
  
  <p>however this does not seem to work either.</p>