Overview
S3M provides several configuration options to control upload behavior, security, and storage settings. All options are defined in theconfig/s3m.php file.
Publishing Configuration
Publish the configuration file to customize S3M settings:config/s3m.php in your project.
Configuration Options
Bucket Configuration
Allows the client to specify a different S3 bucket for uploads.When enabled, users can upload to buckets other than the default configured bucket.
Visibility Configuration
Allows the client to modify the visibility (ACL) of uploaded files.When enabled, users can set file visibility to public or private during upload.The default visibility is
private if not specified.Supported S3 visibility options include:
private, public-read, public-read-write, authenticated-read, aws-exec-read, bucket-owner-read, bucket-owner-full-control.Folder Configuration
Allows the client to specify a custom folder/directory for uploaded files.When disabled, all files are stored in the
/tmp/ directory at the bucket root.The storage format is: /tmp/{filename} where {filename} is a UUID generated for each upload.Files in the
/tmp/ directory should be automatically purged after 24 hours using an S3 lifecycle policy.Middleware Configuration
Middleware stack applied to S3M routes.Define which middleware should be applied to the multipart upload endpoints.
S3 Connection Settings
AWS S3 connection configuration.
S3 Parameters
AWS Access Key ID from environment variable
AWS_ACCESS_KEY_IDAWS Secret Access Key from environment variable
AWS_SECRET_ACCESS_KEYAWS Session Token for temporary credentials from environment variable
AWS_SESSION_TOKENAWS region (e.g.,
us-east-1, eu-west-1) from environment variable AWS_DEFAULT_REGIONDefault S3 bucket name from environment variable
AWS_BUCKETCustom URL for accessing files (e.g., CloudFront CDN) from environment variable
AWS_URLCustom S3 endpoint for S3-compatible services from environment variable
AWS_ENDPOINTUse path-style endpoints instead of virtual-hosted-style from environment variable
AWS_USE_PATH_STYLE_ENDPOINTComplete Configuration Example
Environment Variables
All AWS credentials should be stored in your.env file:
.env