Represents an uploaded file in the ESP RainMaker SDK.

Returned by upload confirm, list, and lookup helpers. Use refresh to fetch the latest metadata, download to fetch file bytes, and updatePublic to change visibility.

Implements

Constructors

Properties

description?: string

User-provided description.

downloadUrl?: string

Presigned download URL when available.

entityId?: string

Entity id the file is associated with.

entityType?: string

Entity type the file is associated with.

fileId: string

The unique file id.

fileMd5?: string

Hex MD5 checksum of the file content.

fileName?: string

RainMaker-side file name.

fileType?: string

Custom file type label.

metadata?: string | Record<string, unknown>

Optional metadata attached at confirm time.

public?: boolean

Whether the file is public.

s3Key?: string

S3 object key.

timestamp?: string

Upload timestamp from the backend.

userId?: string

Owner user id from the backend.

userName?: string

Owner username from the backend.

Methods

  • Deletes this uploaded file from RainMaker.

    Returns Promise<void>

  • Returns the cached presigned download URL without network I/O.

    Returns undefined | string

    The download URL when known.

  • Fetches the latest file metadata from the cloud and updates this instance.

    Returns Promise<null | ESPFile>

    This instance with refreshed fields, or null when no record exists.

  • Sets whether this file is public.

    Parameters

    • isPublic: boolean

      true to make the file public.

    Returns Promise<ESPFile>

    This instance with refreshed fields from the backend.