Represents a file in the object storage.

interface IFile {
    lastModified: number;
    name: string;
    size: number;
    type: string;
    arrayBuffer(): Promise<ArrayBuffer>;
    slice(start?: number, end?: number, contentType?: string): Blob;
    stream(): IReadableStream;
    text(): Promise<string>;
}

Properties

lastModified: number

The last modified timestamp of the file.

name: string

The name of the file.

size: number

The size of the file in bytes.

type: string

The MIME type of the file.

Methods

  • Returns a new Blob object that contains a subset of the file's data.

    Parameters

    • Optionalstart: number

      The start position (inclusive) of the subset. Defaults to 0.

    • Optionalend: number

      The end position (exclusive) of the subset. Defaults to the end of the file.

    • OptionalcontentType: string

      The MIME type of the subset. Defaults to the original file's type.

    Returns Blob

    A Blob object representing the subset of the file's data.

  • Returns a promise that resolves to a string containing the file's data.

    Returns Promise<string>