jovanialferez/yii2-s3

An Amazon S3Client wrapper as Yii2 component

Installs: 2 857

Dependents: 0

Suggesters: 0

Security: 0

Stars: 7

Watchers: 4

Forks: 8

Open Issues: 1

pkg:composer/jovanialferez/yii2-s3

1.0 2015-04-23 01:29 UTC

This package is not auto-updated.

Last update: 2025-12-17 18:09:06 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');