I have a file in input to send in a POST, to transform it in a JSON string I do this:
const buffer = await file.arrayBuffer();
const arrayContent = new Int8Array(buffer);
try {
const resp = await fetch(url, {
method: "POST",
body: JSON.stringify(Array.from(arrayContent.values())),
});
It works perfectly in every browser but Safari (desktop and mobile) when in production. It works in Safari even when in production but with content blocking disabled (not ad blocking, Safari default content blocking). I get this error in the browser console:
Cannot load blob:https://mysitedomain.com/string-of-alphanumerical-characters due to access control checks.
I get the error at the line doing file.arrayBuffer() method. I researched every question but I got nothing on this specific case. Any ideas?