title: Why my image upload logic is always giving me error react native?
body: <p>I got a postman collection like this</p>
  <p>postman header<a href="https://i.stack.imgur.com/1cjtM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1cjtM.png" alt="Header Image" /></a></p>
  <p>postman body<a href="https://i.stack.imgur.com/jP4Kc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/jP4Kc.png" alt="Body" /></a></p>
  <p>Here is my upload logic. I am using <code>react-native-image-picker</code> to access the photo library</p>
  <p>Form making logic</p>
  <pre><code>const createFormData = (photo, body = {}) =&gt; {
    const data = new FormData();
  
    data.append('files', {
      files: photo.assets[0].fileName,
      type: photo.assets[0].type,
      uri:
        Platform.OS === 'ios'
          ? photo.assets[0].uri.replace('file://', '')
          : photo.assets[0].uri,
    }); 
  
    return data;
  };
  </code></pre>
  <p>upload logic</p>
  <pre><code>const handleUploadPhoto = () =&gt; {
      createFormData(photo);
      axios
        .post(
          'userapi/UpdateUserProfileImage',
          {
            body: createFormData(photo),
          },
          {
            headers: {
              'Content-Type': 'application/json',
              'Authorization': '...'
            },
          },
        )
        .then(response =&gt; {
          console.log('response', response.data);
        })
        .catch(error =&gt; {
          console.log('error', error);
        });
    };
  </code></pre>
  <p>I am always getting <code>500 error</code></p>