RefirebaseRefirebase

getBytes

Get the raw bytes of a file.

Usage

Downloads the file entirely into memory as an ArrayBuffer. Throws an error if the download fails.

Example
import { db } from 'refirebase';

const buffer = await db.storage.getBytes('docs/report.pdf');
console.log(buffer.byteLength);

Parameters

ParamTypeDescription
filePath*stringThe path to the file in Storage.

Return value

Returns

Promise<ArrayBuffer>

A promise that resolves to the raw file bytes.