1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 export const fileToArrayBuffer = (file: File) =>
6 new Promise<ArrayBuffer>((resolve, reject) => {
7 const reader = new FileReader();
8 reader.onload = () => {
9 resolve(reader.result as ArrayBuffer);
11 reader.onerror = () => {
14 reader.readAsArrayBuffer(file);