0
I’m with a file upload application, and I need to know how to identify how many bytes my file has, that’s why I’m using Arraybuffer, I know there are other ways to measure the file size, but I’d really like to use Arraybuffer, that was my attempt.
I don’t know if I’m doing it right, and the right way would be another, I need to know the right way and I accept suggestions, here’s the code snippet.
if (x != "undefined"){//uint8array, arraybuffer
await jsZipInstance.file(x).async("arraybuffer").then(function (data) {
var view = new Int8Array(data);
console.log(view.length);
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray/length
– Maury Developer
Read the document below for examples: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Int8Array
– Maury Developer