kenreilly / yii2-s3
An Amazon S3Client wrapper as Yii2 component
Installs: 68
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 8
pkg:composer/kenreilly/yii2-s3
Requires
- aws/aws-sdk-php: 3.48
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2025-09-28 10:11:19 UTC
README
An Amazon S3Client wrapper as Yii2 component.
Usage
return [ // ... 'components' => [ 'storage' => [ 'class' => '\jovanialferez\yii2s3\AmazonS3', 'key' => 'AWS_ACCESS_KEY_ID', 'secret' => 'AWS_SECRET_ACCESS_KEY', 'bucket' => 'YOUR_BUCKET', ], // ... ], ];
You can then start using this component as:
$storage = \Yii::$app->storage; // uploadFile() here returns the resulting S3 url of that file $url = $storage->uploadFile('/path/to/file', 'unique_file_name');