A FileStorage that is backed by an R2 bucket.

Implements

  • FileStorage

Constructors

Properties

Methods

Constructors

Properties

r2: R2Bucket

The R2Bucket bindings to use

Methods

  • Returns the file with the given key, or null if no such key exists.

    Parameters

    • key: string

    Returns Promise<null | File>

  • Returns true if a file with the given key exists, false otherwise.

    Parameters

    • key: string

    Returns Promise<boolean>

  • Removes the file with the given key from storage.

    Parameters

    • key: string

    Returns Promise<void>

  • Puts a file in storage at the given key.

    Parameters

    • key: string
    • file: File

    Returns Promise<void>