Storage.Services.S3 (PhoenixContribStorage v0.1.0)
View SourceAmazon S3 storage service implementation.
Requires the following dependencies to be added to your mix.exs:
{:ex_aws, "~> 2.4"},
{:ex_aws_s3, "~> 2.4"},
{:hackney, "~> 1.18"},
{:sweet_xml, "~> 0.7"}
Configuration
config :phoenix_contrib_storage,
services: %{
s3: {Storage.Services.S3,
bucket: "my-bucket",
region: "us-east-1",
access_key_id: {:system, "AWS_ACCESS_KEY_ID"},
secret_access_key: {:system, "AWS_SECRET_ACCESS_KEY"}
}
}
Summary
Functions
Checks if an object exists in S3.
Gets object metadata without downloading the file.
Lists objects in the bucket with optional prefix.
Generates a signed URL for direct uploads.