Is there a way to use the Fetch API to load a binary file (e.g. in S3 using a signed URL)?
This would be a simple PUT for some "application / octet-stream".
The XHR library works, but I think Fetch is better, especially in a React-Native environment.
Does React-Native Fetch Blobcurrently support ?
Ideally, I would like to do something similar, but Blobnot defined:
fetch('https://s3.amazonaws.com/signedUrl/', {
method: 'PUT',
headers: {
'Content-Type': 'application/octet-stream',
},
body: Blob(filePath)
})
source
share