Does google chorme version 75 support .arrayBuffer()?

47 views Asked by At

Help me, Does google chorme version 75 support .arrayBuffer()?. In Google Chrome version 75, the function .arrayBuffer is reported as not being a function

I have tested it on higher versions, and .arrayBuffer works normally. And here is the piece of code that I use involving .arrayBuffer(): Array.from(file.files).forEach((f, i) => { zip.file(f.webkitRelativePath, f.arrayBuffer()) })

1

There are 1 answers

1
Venkat On BEST ANSWER

It is not supported in version 75. Instead you can try this I think it will work

Array.from(file.files).forEach((f, i) => {
  const reader = new FileReader();
  reader.onload = function (e) {
    // e.target.result contains the file contents as an ArrayBuffer
    zip.file(f.webkitRelativePath, e.target.result);
  };
  reader.readAsArrayBuffer(f);
});