Function tauri_sys::fs::read_binary_file

source ·
pub async fn read_binary_file(
    path: &Path,
    dir: BaseDirectory,
) -> Result<Vec<u8>, Error>
Expand description

Reads a file as a byte array.

§Example

use tauri_sys::fs;

let contents = fs::read_binary_file(filePath, BaseDirectory::Download).expect("could not read file contents");

Requires allowlist > fs > readBinaryFile to be enabled.