I need to PUT an image file from the react native app to an pre-configured s3 upload URL. I saw an example with fetch that uploads the image as a binary via path, but it does so as a multi-part form upload. Because the s3 upload url can only take it as a raw binary in the body - and not as a content-type of multi-part, what's the syntax to PUT the raw binary image as the body using fetch or any other library in react native?
The following code uploads it as form data - which is not what I want to do.
var photo = {
uri: response.uri,
name: fileName,
};
const body = new FormData(); // how can I do this not as a form?
body.append('photo', photo);
const results = await fetch('https://somes3uploadurl.com, {
method: 'PUT',
body,
});