How to include a photo's UTF8 string in a fetch PUT request body?

Hi folks,

I’m trying to upload an image taken by the phone’s camera up to Azure’s Blob Storage service. You can upload to the service using a simple HTTP PUT request, in which the image’s UTF8 payload is the request body.

I’ve got some code like follows …

const fileContent = await FileSystem.readAsStringAsync(photo.url, { encoding: FileSystem.EncodingType.UTF8 });

This seems to return not what I’d expect, though. It’s returning a small string that contains about 4 characters and they’re all the same-looking character - not what I’d expect when looking at a 1-3MB image file.

If I use the Base64 encoding, I see the image contents more like I’d expect.

So my question is this, how can I get that image’s UTF8 content, on the device, so that I can include it in this HTTP PUT requests body?

Thank you!