PhoenixKit.Modules.Storage.Providers.S3 (phoenix_kit v2.40.1)

Copy Markdown View Source

AWS S3 storage provider.

Stores files in Amazon S3 buckets using the ExAWS library. Supports all S3-compatible services (like Backblaze B2, Cloudflare R2, Tigris).

Files under 5 MB are uploaded via put_object (single request). Files at or above 5 MB use multipart upload via ExAws.S3.upload/4 with streaming and concurrent chunk uploads.

Summary

Functions

A bucket's endpoint, parsed: %{scheme:, host:, port:}; nil when none is set (plain AWS); {:error, :invalid_endpoint} when one is set but cannot be used. The one place an endpoint is read, so the host requests go to and the host a public URL names cannot disagree.

Functions

endpoint(arg1)

@spec endpoint(map()) ::
  %{scheme: String.t(), host: String.t(), port: pos_integer()}
  | nil
  | {:error, :invalid_endpoint}

A bucket's endpoint, parsed: %{scheme:, host:, port:}; nil when none is set (plain AWS); {:error, :invalid_endpoint} when one is set but cannot be used. The one place an endpoint is read, so the host requests go to and the host a public URL names cannot disagree.

Accepted: a bare host (s3.us-west-002.backblazeb2.com), host:port, or an http/https URL with no path (http://minio.local:9000, https://h/); the scheme defaults to https. Refused rather than read as plain AWS: any other scheme, a path (a gateway prefix would be dropped silently), a query, and an IPv6 zone id (%eth0).