To get a file or blob from an object URL with JavaScript, we use fetch
.
For instance, we write
const r = await fetch(url);
const blob = await r.blob();
to call fetch
with the object url
to get the r
response from the returned promise via await
.
Then we call r.blob
to return a promise with the blob
.