I want to have access to ArrayBuffer from remote URL. So, I created the function:
fetch('some url')
.then(function(response) {
const file = new File([response], response.url, {type:'image/jpg'});
const reader = new FileReader();
reader.readAsArrayBuffer(file);
reader.onload = function(e) {
const dataURL = reader.result;
console.log(dataURL);
};
})
And I've got the wrong ArrayBuffer size: ArrayBuffer(17 = length of my Url) instead of real image size (about 24000, I think). What's the problem here?