Implements: frostealth\yii2\aws\s3\StorageInterface
Inheritance: yii\base\Component
Property | Type | Required | Description |
---|---|---|---|
$credentials | Aws\Credentials\CredentialsInterface|array|callable | yes | Specifies the credentials used to sign requests. |
$region | string | yes | Region to connect to. Available regions. |
$bucket | string | yes | The bucket name. |
$debug | boolean|array | no | Set to true to display debug information when sending requests. |
$options | array | no | Other S3Client options. |
$defaultAcl | string | no | Default ACL. |
$cdnHostname | string | no | The full URL of the CloudFront. |
Constant | Value |
---|---|
ACL_PRIVATE | 'private' |
ACL_PUBLIC_READ | 'public-read' |
ACL_PUBLIC_READ_WRITE | 'public-read-write' |
ACL_AUTHENTICATED_READ | 'authenticated-read' |
ACL_BUCKET_OWNER_READ | 'bucket-owner-read' |
ALC_BUCKET_OWNER_FULL_CONTROL | 'bucket-owner-full-control' |
Adds an object to a bucket.
Argument | Type | Description |
---|---|---|
$filename | string | |
$data | mixed | Object data to upload. Can be a Psr\Http\Message\StreamInterface, php stream resource, or a string of data to upload. |
$acl | string | ACL to apply to the object. |
$options | array | Other parameters. |
return | Aws\ResultInterface | See result syntax. |
Retrieves an object from Amazon S3.
Argument | Type | Description |
---|---|---|
$filename | string | |
$saveAs | string | The path to a file on disk to save the object data. |
return | Aws\ResultInterface | See result syntax. |
Determines whether or not an object exists by name.
Argument | Type | Description |
---|---|---|
$filename | string | |
$options | array | Additional options available in the HeadObject operation (e.g., VersionId). |
return | boolean |
Removes an object from Amazon S3.
Argument | Type | Description |
---|---|---|
$filename | string | |
return | Aws\ResultInterface | See result syntax. |
Returns the URL to an object identified by its bucket and key.
Argument | Type | Description |
---|---|---|
$filename | string | |
return | string |
Create a pre-signed URL.
Argument | Type | Description |
---|---|---|
$filename | string | |
$expires | string|integer|DateTime | The time at which the URL should expire. This can be a Unix timestamp, a PHP DateTime object, or a string that can be evaluated by strtotime(). |
return | string |
Returns the CloundFront URL to an object.
Argument | Type | Description |
---|---|---|
$filename | string | |
return | string |
Returns some or all (up to 1000] of the objects in a bucket.
Argument | Type | Description |
---|---|---|
$prefix | string | Limits the response to keys that begin with the specified prefix. |
$options | array | Other parameters. |
return | Aws\ResultInterface | See result syntax. |
Upload a file, stream, or string to a bucket.
If the upload size exceeds the specified threshold, the upload will be performed using concurrent multipart uploads.
Argument | Type | Description |
---|---|---|
$filename | string | |
$source | mixed | Object data to upload. Can be a Psr\Http\Message\StreamInterface, php stream resource, or a string of data to upload. |
$acl | string | ACL to apply to the object. |
$options | array | Options used to configure the upload process. See more. |
return | Aws\ResultInterface | Returns the result of the upload. |
uploadAsync($filename, $source, $concurrency = null, $partSize = null, $acl = null, array $options = [])
Upload a file, stream, or string to a bucket asynchronously.
Argument | Type | Description |
---|---|---|
$filename | string | |
$source | mixed | Object data to upload. Can be a Psr\Http\Message\StreamInterface, php stream resource, or a string of data to upload. |
$concurrency | integer | Maximum number of concurrent UploadPart operations allowed during the multipart upload. Default 5. |
$partSize | integer | Part size, in bytes, to use when doing a multipart upload. This must between 5 MB and 5 GB, inclusive. Default 5242880 (512 MB). |
$acl | string | ACL to apply to the object. |
$options | array | Options used to configure the upload process. See more. |
return | GuzzleHttp\Promise\PromiseInterface | Returns a promise that will be fulfilled with the result of the upload. |
Returns the S3Client
object.
Argument | Type | Description |
---|---|---|
return | Aws\S3\S3Client |