const size = image.size / 1024;
console.log(size);
if (size >= 4096) {
console.log("Error, image to large");
return;
}
const foundText = await image.arrayBuffer();
console.log("NewSize", foundText.byteLength / 1024);
const uint = new Uint8Array(foundText);
console.log("BlogStringw", uint.length / 1024); // Shows the correct size, if I upload a 3mb file it shows its 3000kb.
upload(uint, false, image.type);
setImage(null);
setIsDragging(false);
const size = image.size / 1024;
console.log(size);
if (size >= 4096) {
console.log("Error, image to large");
return;
}
const foundText = await image.arrayBuffer();
console.log("NewSize", foundText.byteLength / 1024);
const uint = new Uint8Array(foundText);
console.log("BlogStringw", uint.length / 1024); // Shows the correct size, if I upload a 3mb file it shows its 3000kb.
upload(uint, false, image.type);
setImage(null);
setIsDragging(false);