Uploadex v2.0.2 Uploadex.S3Storage View Source
Storage for AWS S3.
Opts
bucket
: String (required for all functions)region
: String (required forUploadex.Storage.get_url/2
)directory
: String (required for all functions)upload_opts
: Keyword list. This opts are passed toExAws.S3.upload/4
andExAws.S3.put_object/4
(required forUploadex.Storage.store/2
)
Example
To use this storage for your User
record, define these functions in your Uploadex.Uploader
implementation:
def default_opts(Uploadex.S3Storage), do: [bucket: "my_bucket", region: "sa-east-1", upload_opts: [acl: :public_read]]
def storage(%User{} = user, :photo), do: {Uploadex.S3Storage, directory: "/photos"}