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 => {
7 const reader = new FileReader();
8 reader.onload = () => {
9 resolve(reader.result as ArrayBuffer);
11 reader.readAsArrayBuffer(file);