Stratal API Reference
    Preparing search index...

    Class S3StorageProvider

    S3 Storage Provider Implements storage operations using AWS SDK for S3-compatible storage Works with AWS S3, Cloudflare R2, MinIO, and other S3-compatible services

    Implements IS3MultipartProvider for multipart upload support needed by TUS

    Implements

    Index

    Constructors

    Methods

    • Chunked upload for streaming data without known size Uses @aws-sdk/lib-storage for multipart upload handling

      Benefits:

      • Handles unknown Content-Length automatically
      • Automatic retry on transient failures
      • Cleanup of partial uploads on error
      • Works with S3-compatible storage (R2, MinIO, RustFS)

      Parameters

      • body: StreamingBlobPayloadInputTypes | undefined

        Content to upload (stream or buffer)

      • path: string

        Full path including disk root

      • options: Omit<UploadOptions, "size"> & { size?: number }

        Upload options (mimeType required, size optional)

      Returns Promise<
          {
              disk: string;
              fullPath: string;
              mimeType: string;
              path: string;
              size: number;
              uploadedAt: Date;
          },
      >

      Upload result with metadata

    • Generate a presigned URL for temporary access

      Parameters

      • path: string

        Full path to the file

      • method: "GET" | "PUT" | "DELETE" | "HEAD"

        HTTP method (GET, PUT, DELETE, HEAD)

      • expiresIn: number

        Expiry time in seconds (1-604800)

      Returns Promise<
          {
              expiresAt: Date;
              expiresIn: number;
              method: "GET"
              | "PUT"
              | "DELETE"
              | "HEAD";
              url: string;
          },
      >

      Presigned URL result

    • Upload content to storage

      Parameters

      • body: StreamingBlobPayloadInputTypes | undefined

        Content to upload (stream, buffer, or string)

      • path: string

        Full path including disk root

      • options: UploadOptions

        Upload options including size and mime type

      Returns Promise<
          {
              disk: string;
              fullPath: string;
              mimeType: string;
              path: string;
              size: number;
              uploadedAt: Date;
          },
      >

      Upload result with metadata