AWS SDK for PHP 3.x
  • Namespace
  • Class
Did this page help you? SUBMIT FEEDBACK!

Namespaces

  • Aws
    • AccessAnalyzer
      • Exception
    • Account
      • Exception
    • Acm
      • Exception
    • ACMPCA
      • Exception
    • AlexaForBusiness
      • Exception
    • Amplify
      • Exception
    • AmplifyBackend
      • Exception
    • AmplifyUIBuilder
      • Exception
    • Api
      • ErrorParser
      • Parser
        • Exception
      • Serializer
    • ApiGateway
      • Exception
    • ApiGatewayManagementApi
      • Exception
    • ApiGatewayV2
      • Exception
    • AppConfig
      • Exception
    • AppConfigData
      • Exception
    • Appflow
      • Exception
    • AppIntegrationsService
      • Exception
    • ApplicationAutoScaling
      • Exception
    • ApplicationCostProfiler
      • Exception
    • ApplicationDiscoveryService
      • Exception
    • ApplicationInsights
      • Exception
    • AppMesh
      • Exception
    • AppRegistry
      • Exception
    • AppRunner
      • Exception
    • Appstream
      • Exception
    • AppSync
      • Exception
    • ARCZonalShift
      • Exception
    • Arn
      • Exception
    • Athena
      • Exception
    • AuditManager
      • Exception
    • AugmentedAIRuntime
      • Exception
    • AutoScaling
      • Exception
    • AutoScalingPlans
      • Exception
    • Backup
      • Exception
    • BackupGateway
      • Exception
    • BackupStorage
      • Exception
    • Batch
      • Exception
    • BillingConductor
      • Exception
    • Braket
      • Exception
    • Budgets
      • Exception
    • Chime
      • Exception
    • ChimeSDKIdentity
      • Exception
    • ChimeSDKMediaPipelines
      • Exception
    • ChimeSDKMeetings
      • Exception
    • ChimeSDKMessaging
      • Exception
    • ChimeSDKVoice
      • Exception
    • CleanRooms
      • Exception
    • ClientSideMonitoring
      • Exception
    • Cloud9
      • Exception
    • CloudControlApi
      • Exception
    • CloudDirectory
      • Exception
    • CloudFormation
      • Exception
    • CloudFront
      • Exception
    • CloudHsm
      • Exception
    • CloudHSMV2
      • Exception
    • CloudSearch
      • Exception
    • CloudSearchDomain
      • Exception
    • CloudTrail
      • Exception
    • CloudTrailData
      • Exception
    • CloudWatch
      • Exception
    • CloudWatchEvents
      • Exception
    • CloudWatchEvidently
      • Exception
    • CloudWatchLogs
      • Exception
    • CloudWatchRUM
      • Exception
    • CodeArtifact
      • Exception
    • CodeBuild
      • Exception
    • CodeCatalyst
      • Exception
    • CodeCommit
      • Exception
    • CodeDeploy
      • Exception
    • CodeGuruProfiler
      • Exception
    • CodeGuruReviewer
      • Exception
    • CodePipeline
      • Exception
    • CodeStar
      • Exception
    • CodeStarconnections
      • Exception
    • CodeStarNotifications
      • Exception
    • CognitoIdentity
      • Exception
    • CognitoIdentityProvider
      • Exception
    • CognitoSync
      • Exception
    • Comprehend
      • Exception
    • ComprehendMedical
      • Exception
    • ComputeOptimizer
      • Exception
    • ConfigService
      • Exception
    • Connect
      • Exception
    • ConnectCampaignService
      • Exception
    • ConnectCases
      • Exception
    • ConnectContactLens
      • Exception
    • ConnectParticipant
      • Exception
    • ConnectWisdomService
      • Exception
    • ControlTower
      • Exception
    • CostandUsageReportService
      • Exception
    • CostExplorer
      • Exception
    • Credentials
    • Crypto
      • Cipher
      • Polyfill
    • CustomerProfiles
      • Exception
    • DatabaseMigrationService
      • Exception
    • DataExchange
      • Exception
    • DataPipeline
      • Exception
    • DataSync
      • Exception
    • DAX
      • Exception
    • DefaultsMode
      • Exception
    • Detective
      • Exception
    • DeviceFarm
      • Exception
    • DevOpsGuru
      • Exception
    • DirectConnect
      • Exception
    • DirectoryService
      • Exception
    • DLM
      • Exception
    • DocDB
      • Exception
    • DocDBElastic
      • Exception
    • drs
      • Exception
    • DynamoDb
      • Exception
    • DynamoDbStreams
      • Exception
    • EBS
      • Exception
    • Ec2
      • Exception
    • EC2InstanceConnect
      • Exception
    • Ecr
      • Exception
    • ECRPublic
      • Exception
    • Ecs
      • Exception
    • Efs
      • Exception
    • EKS
      • Exception
    • ElastiCache
      • Exception
    • ElasticBeanstalk
      • Exception
    • ElasticInference
      • Exception
    • ElasticLoadBalancing
      • Exception
    • ElasticLoadBalancingV2
      • Exception
    • ElasticsearchService
      • Exception
    • ElasticTranscoder
      • Exception
    • Emr
      • Exception
    • EMRContainers
      • Exception
    • EMRServerless
      • Exception
    • Endpoint
      • UseDualstackEndpoint
        • Exception
      • UseFipsEndpoint
        • Exception
    • EndpointDiscovery
      • Exception
    • EndpointV2
      • Rule
      • Ruleset
    • EventBridge
      • Exception
    • Exception
    • finspace
      • Exception
    • FinSpaceData
      • Exception
    • Firehose
      • Exception
    • FIS
      • Exception
    • FMS
      • Exception
    • ForecastQueryService
      • Exception
    • ForecastService
      • Exception
    • FraudDetector
      • Exception
    • FSx
      • Exception
    • GameLift
      • Exception
    • GameSparks
      • Exception
    • Glacier
      • Exception
    • GlobalAccelerator
      • Exception
    • Glue
      • Exception
    • GlueDataBrew
      • Exception
    • Greengrass
      • Exception
    • GreengrassV2
      • Exception
    • GroundStation
      • Exception
    • GuardDuty
      • Exception
    • Handler
      • GuzzleV5
      • GuzzleV6
    • Health
      • Exception
    • HealthLake
      • Exception
    • Honeycode
      • Exception
    • Iam
      • Exception
    • IdentityStore
      • Exception
    • imagebuilder
      • Exception
    • ImportExport
      • Exception
    • Inspector
      • Exception
    • Inspector2
      • Exception
    • InternetMonitor
      • Exception
    • Iot
      • Exception
    • IoT1ClickDevicesService
      • Exception
    • IoT1ClickProjects
      • Exception
    • IoTAnalytics
      • Exception
    • IotDataPlane
      • Exception
    • IoTDeviceAdvisor
      • Exception
    • IoTEvents
      • Exception
    • IoTEventsData
      • Exception
    • IoTFleetHub
      • Exception
    • IoTFleetWise
      • Exception
    • IoTJobsDataPlane
      • Exception
    • IoTRoboRunner
      • Exception
    • IoTSecureTunneling
      • Exception
    • IoTSiteWise
      • Exception
    • IoTThingsGraph
      • Exception
    • IoTTwinMaker
      • Exception
    • IoTWireless
      • Exception
    • IVS
      • Exception
    • ivschat
      • Exception
    • IVSRealTime
      • Exception
    • Kafka
      • Exception
    • KafkaConnect
      • Exception
    • kendra
      • Exception
    • KendraRanking
      • Exception
    • Keyspaces
      • Exception
    • Kinesis
      • Exception
    • KinesisAnalytics
      • Exception
    • KinesisAnalyticsV2
      • Exception
    • KinesisVideo
      • Exception
    • KinesisVideoArchivedMedia
      • Exception
    • KinesisVideoMedia
      • Exception
    • KinesisVideoSignalingChannels
      • Exception
    • KinesisVideoWebRTCStorage
      • Exception
    • Kms
      • Exception
    • LakeFormation
      • Exception
    • Lambda
      • Exception
    • LexModelBuildingService
      • Exception
    • LexModelsV2
      • Exception
    • LexRuntimeService
      • Exception
    • LexRuntimeV2
      • Exception
    • LicenseManager
      • Exception
    • LicenseManagerLinuxSubscriptions
      • Exception
    • LicenseManagerUserSubscriptions
      • Exception
    • Lightsail
      • Exception
    • LocationService
      • Exception
    • LookoutEquipment
      • Exception
    • LookoutforVision
      • Exception
    • LookoutMetrics
      • Exception
    • MachineLearning
      • Exception
    • Macie
      • Exception
    • Macie2
      • Exception
    • MainframeModernization
      • Exception
    • ManagedBlockchain
      • Exception
    • ManagedGrafana
      • Exception
    • MarketplaceCatalog
      • Exception
    • MarketplaceCommerceAnalytics
      • Exception
    • MarketplaceEntitlementService
      • Exception
    • MarketplaceMetering
      • Exception
    • MediaConnect
      • Exception
    • MediaConvert
      • Exception
    • MediaLive
      • Exception
    • MediaPackage
      • Exception
    • MediaPackageVod
      • Exception
    • MediaStore
      • Exception
    • MediaStoreData
      • Exception
    • MediaTailor
      • Exception
    • MemoryDB
      • Exception
    • mgn
      • Exception
    • MigrationHub
      • Exception
    • MigrationHubConfig
      • Exception
    • MigrationHubOrchestrator
      • Exception
    • MigrationHubRefactorSpaces
      • Exception
    • MigrationHubStrategyRecommendations
      • Exception
    • Mobile
      • Exception
    • MQ
      • Exception
    • MTurk
      • Exception
    • Multipart
    • MWAA
      • Exception
    • Neptune
      • Exception
    • NetworkFirewall
      • Exception
    • NetworkManager
      • Exception
    • NimbleStudio
      • Exception
    • OAM
      • Exception
    • Omics
      • Exception
    • OpenSearchServerless
      • Exception
    • OpenSearchService
      • Exception
    • OpsWorks
      • Exception
    • OpsWorksCM
      • Exception
    • Organizations
      • Exception
    • Outposts
      • Exception
    • Panorama
      • Exception
    • Personalize
      • Exception
    • PersonalizeEvents
      • Exception
    • PersonalizeRuntime
      • Exception
    • PI
      • Exception
    • Pinpoint
      • Exception
    • PinpointEmail
      • Exception
    • PinpointSMSVoice
      • Exception
    • PinpointSMSVoiceV2
      • Exception
    • Pipes
      • Exception
    • Polly
      • Exception
    • Pricing
      • Exception
    • PrivateNetworks
      • Exception
    • PrometheusService
      • Exception
    • Proton
      • Exception
    • QLDB
      • Exception
    • QLDBSession
      • Exception
    • QuickSight
      • Exception
    • RAM
      • Exception
    • Rds
      • Exception
    • RDSDataService
      • Exception
    • RecycleBin
      • Exception
    • Redshift
      • Exception
    • RedshiftDataAPIService
      • Exception
    • RedshiftServerless
      • Exception
    • Rekognition
      • Exception
    • ResilienceHub
      • Exception
    • ResourceExplorer2
      • Exception
    • ResourceGroups
      • Exception
    • ResourceGroupsTaggingAPI
      • Exception
    • Retry
      • Exception
    • RoboMaker
      • Exception
    • RolesAnywhere
      • Exception
    • Route53
      • Exception
    • Route53Domains
      • Exception
    • Route53RecoveryCluster
      • Exception
    • Route53RecoveryControlConfig
      • Exception
    • Route53RecoveryReadiness
      • Exception
    • Route53Resolver
      • Exception
    • S3
      • Crypto
      • Exception
      • RegionalEndpoint
        • Exception
      • UseArnRegion
        • Exception
    • S3Control
      • Exception
    • S3Outposts
      • Exception
    • SageMaker
      • Exception
    • SagemakerEdgeManager
      • Exception
    • SageMakerFeatureStoreRuntime
      • Exception
    • SageMakerGeospatial
      • Exception
    • SageMakerMetrics
      • Exception
    • SageMakerRuntime
      • Exception
    • SavingsPlans
      • Exception
    • Scheduler
      • Exception
    • Schemas
      • Exception
    • Script
      • Composer
    • SecretsManager
      • Exception
    • SecurityHub
      • Exception
    • SecurityLake
      • Exception
    • ServerlessApplicationRepository
      • Exception
    • ServiceCatalog
      • Exception
    • ServiceDiscovery
      • Exception
    • ServiceQuotas
      • Exception
    • Ses
      • Exception
    • SesV2
      • Exception
    • Sfn
      • Exception
    • Shield
      • Exception
    • Signature
    • signer
      • Exception
    • SimSpaceWeaver
      • Exception
    • Sms
      • Exception
    • SnowBall
      • Exception
    • SnowDeviceManagement
      • Exception
    • Sns
      • Exception
    • Sqs
      • Exception
    • Ssm
      • Exception
    • SSMContacts
      • Exception
    • SSMIncidents
      • Exception
    • SsmSap
      • Exception
    • SSO
      • Exception
    • SSOAdmin
      • Exception
    • SSOOIDC
      • Exception
    • StorageGateway
      • Exception
    • Sts
      • Exception
      • RegionalEndpoints
        • Exception
    • Support
      • Exception
    • SupportApp
      • Exception
    • Swf
      • Exception
    • Synthetics
      • Exception
    • Textract
      • Exception
    • TimestreamQuery
      • Exception
    • TimestreamWrite
      • Exception
    • Tnb
      • Exception
    • Token
    • TranscribeService
      • Exception
    • Transfer
      • Exception
    • Translate
      • Exception
    • VoiceID
      • Exception
    • VPCLattice
      • Exception
    • Waf
      • Exception
    • WafRegional
      • Exception
    • WAFV2
      • Exception
    • WellArchitected
      • Exception
    • WorkDocs
      • Exception
    • WorkLink
      • Exception
    • WorkMail
      • Exception
    • WorkMailMessageFlow
      • Exception
    • WorkSpaces
      • Exception
    • WorkSpacesWeb
      • Exception
    • XRay
      • Exception
  • GuzzleHttp
    • Promise
    • Psr7
  • Psr
    • Http
      • Message

Classes

  • BatchDelete
  • GetBucketLocationParser
  • MultipartUploader
  • ObjectCopier
  • ObjectUploader
  • PostObject
  • PostObjectV4
  • S3Client
  • S3MultiRegionClient
  • S3UriParser
  • StreamWrapper
  • Transfer
  • ValidateResponseChecksumParser

Interfaces

  • S3ClientInterface

Traits

  • CalculatesChecksumTrait
  • MultipartUploadingTrait
  • S3ClientTrait

Interface S3ClientInterface

Aws\S3\S3ClientInterface implements Aws\AwsClientInterface
Namespace: Aws\S3
Located at S3/S3ClientInterface.php

Represents an AWS client.

Direct known implementers

Aws\S3\S3Client, Aws\S3\S3MultiRegionClient

Methods Summary

  • createPresignedRequest ( Aws\CommandInterface $command, int|string|\DateTimeInterface $expires, array $options = [] )

    Create a pre-signed URL for the given S3 command object.

  • getObjectUrl ( string $bucket, string $key )

    Returns the URL to an object identified by its bucket and key.

  • doesBucketExist ( string $bucket )
  • doesBucketExistV2 ( string $bucket, bool $accept403 )

    Determines whether or not a bucket exists by name. This method uses S3's HeadBucket operation and requires the relevant bucket permissions in the default case to prevent errors.

  • doesObjectExist ( string $bucket, string $key, array $options = [] )
  • doesObjectExistV2 ( string $bucket, string $key, bool $includeDeleteMarkers = false, array $options = [] )

    Determines whether or not an object exists by name. This method uses S3's HeadObject operation and requires the relevant bucket and object permissions to prevent errors.

  • registerStreamWrapper ( )

    Register the Amazon S3 stream wrapper with this client instance.

  • registerStreamWrapperV2 ( )

    Registers the Amazon S3 stream wrapper with this client instance.

  • deleteMatchingObjects ( string $bucket, string $prefix = '', string $regex = '', array $options = [] )

    Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.

  • deleteMatchingObjectsAsync ( string $bucket, string $prefix = '', string $regex = '', array $options = [] )

    Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.

  • upload ( string $bucket, string $key, mixed $body, string $acl = 'private', array $options = [] )

    Upload a file, stream, or string to a bucket.

  • uploadAsync ( string $bucket, string $key, mixed $body, string $acl = 'private', array $options = [] )

    Upload a file, stream, or string to a bucket asynchronously.

  • copy ( string $fromBucket, string $fromKey, string $destBucket, string $destKey, string $acl = 'private', array $options = [] )

    Copy an object of any size to a different location.

  • copyAsync ( string $fromBucket, string $fromKey, string $destBucket, string $destKey, string $acl = 'private', array $options = [] )

    Copy an object of any size to a different location asynchronously.

  • uploadDirectory ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] )

    Recursively uploads all files in a given directory to a given bucket.

  • uploadDirectoryAsync ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] )

    Recursively uploads all files in a given directory to a given bucket.

  • downloadBucket ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] )

    Downloads a bucket to the local filesystem

  • downloadBucketAsync ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] )

    Downloads a bucket to the local filesystem

  • determineBucketRegion ( string $bucketName )

    Returns the region in which a given bucket is located.

  • determineBucketRegionAsync ( string $bucketName )

    Returns a promise fulfilled with the region in which a given bucket is located.

Methods inherited from Aws\AwsClientInterface

__call(), execute(), executeAsync(), getApi(), getCommand(), getConfig(), getCredentials(), getEndpoint(), getHandlerList(), getIterator(), getPaginator(), getRegion(), getWaiter(), waitUntil()

Methods Details

Psr\Http\Message\RequestInterface createPresignedRequest ( Aws\CommandInterface $command, integer|string|DateTimeInterface $expires, array $options = [] )

Create a pre-signed URL for the given S3 command object.

Parameters

Aws\CommandInterface $command

Command to create a pre-signed URL for.

integer|string|DateTimeInterface $expires

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().

array $options = []

Returns

Psr\Http\Message\RequestInterface

string getObjectUrl ( string $bucket, string $key )

Returns the URL to an object identified by its bucket and key.

The URL returned by this method is not signed nor does it ensure that the bucket and key given to the method exist. If you need a signed URL, then use the \Aws\S3\S3Client::createPresignedRequest method and get the URI of the signed request.

Parameters

string $bucket The name of the bucket where the object is located
string $key The key of the object

Returns

string
The URL to the object

boolean doesBucketExist ( string $bucket )

Deprecated

Use doesBucketExistV2() instead

Determines whether or not a bucket exists by name.


Parameters

string $bucket The name of the bucket

Returns

boolean

boolean doesBucketExistV2 ( string $bucket, boolean $accept403 )

Determines whether or not a bucket exists by name. This method uses S3's HeadBucket operation and requires the relevant bucket permissions in the default case to prevent errors.

Parameters

string $bucket The name of the bucket
boolean $accept403

Set to true for this method to return true in the case of invalid bucket-level permissions. Credentials MUST be valid to avoid inaccuracies. Using the default value of false will cause an exception to be thrown instead.

Returns

boolean

Exceptions

Aws\S3\Exception\S3Exception|Exception
if there is an unhandled exception

boolean doesObjectExist ( string $bucket, string $key, array $options = [] )

Deprecated

Use doesObjectExistV2() instead

Determines whether or not an object exists by name.


Parameters

string $bucket The name of the bucket
string $key The key of the object
array $options = []

Additional options available in the HeadObject operation (e.g., VersionId).

Returns

boolean

boolean doesObjectExistV2 ( string $bucket, string $key, boolean $includeDeleteMarkers = false, array $options = [] )

Determines whether or not an object exists by name. This method uses S3's HeadObject operation and requires the relevant bucket and object permissions to prevent errors.

Parameters

string $bucket The name of the bucket
string $key The key of the object
boolean $includeDeleteMarkers = false

Set to true to consider delete markers existing objects. Using the default value of false will ignore delete markers and return false.

array $options = []

Additional options available in the HeadObject operation (e.g., VersionId).

Returns

boolean

Exceptions

Aws\S3\Exception\S3Exception|Exception
if there is an unhandled exception

registerStreamWrapper ( )

Register the Amazon S3 stream wrapper with this client instance.

registerStreamWrapperV2 ( )

Registers the Amazon S3 stream wrapper with this client instance.

This version uses doesObjectExistV2 and doesBucketExistV2 to check resource existence.

deleteMatchingObjects ( string $bucket, string $prefix = '', string $regex = '', array $options = [] )

Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.

Parameters

string $bucket Bucket that contains the object keys
string $prefix = '' Optionally delete only objects under this key prefix
string $regex = '' Delete only objects that match this regex
array $options = [] Aws\S3\BatchDelete options array.

Exceptions

RuntimeException
if no prefix and no regex is given

See

Aws\S3\S3Client::listObjects

GuzzleHttp\Promise\PromiseInterface deleteMatchingObjectsAsync ( string $bucket, string $prefix = '', string $regex = '', array $options = [] )

Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you to do things like delete all objects that match a specific key prefix.

Parameters

string $bucket Bucket that contains the object keys
string $prefix = '' Optionally delete only objects under this key prefix
string $regex = '' Delete only objects that match this regex
array $options = [] Aws\S3\BatchDelete options array.

Returns

GuzzleHttp\Promise\PromiseInterface

A promise that is settled when matching objects are deleted.

See

Aws\S3\S3Client::listObjects

Aws\ResultInterface upload ( string $bucket, string $key, mixed $body, string $acl = 'private', array $options = [] )

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.

The options array accepts the following options:

  • before_upload: (callable) Callback to invoke before any upload operations during the upload process. The callback should have a function signature like function (Aws\Command $command) {...}.
  • concurrency: (int, default=int(3)) Maximum number of concurrent UploadPart operations allowed during a multipart upload.
  • mup_threshold: (int, default=int(16777216)) The size, in bytes, allowed before the upload must be sent via a multipart upload. Default: 16 MB.
  • params: (array, default=array([])) Custom parameters to use with the upload. For single uploads, they must correspond to those used for the PutObject operation. For multipart uploads, they correspond to the parameters of the CreateMultipartUpload operation.
  • part_size: (int) Part size to use when doing a multipart upload.

Parameters

string $bucket Bucket to upload the object.
string $key Key of the object.
mixed $body

Object data to upload. Can be a StreamInterface, PHP stream resource, or a string of data to upload.

string $acl = 'private' ACL to apply to the object (default: private).
array $options = [] Options used to configure the upload process.

Returns

Aws\ResultInterface
Returns the result of the upload.

See

Aws\S3\MultipartUploader for more info about multipart uploads.

GuzzleHttp\Promise\PromiseInterface uploadAsync ( string $bucket, string $key, mixed $body, string $acl = 'private', array $options = [] )

Upload a file, stream, or string to a bucket asynchronously.

Parameters

string $bucket Bucket to upload the object.
string $key Key of the object.
mixed $body

Object data to upload. Can be a StreamInterface, PHP stream resource, or a string of data to upload.

string $acl = 'private' ACL to apply to the object (default: private).
array $options = [] Options used to configure the upload process.

Returns

GuzzleHttp\Promise\PromiseInterface

Returns a promise that will be fulfilled with the result of the upload.

See

self::upload

Aws\ResultInterface copy ( string $fromBucket, string $fromKey, string $destBucket, string $destKey, string $acl = 'private', array $options = [] )

Copy an object of any size to a different location.

If the upload size exceeds the maximum allowable size for direct S3 copying, a multipart copy will be used.

The options array accepts the following options:

  • before_upload: (callable) Callback to invoke before any upload operations during the upload process. The callback should have a function signature like function (Aws\Command $command) {...}.
  • concurrency: (int, default=int(5)) Maximum number of concurrent UploadPart operations allowed during a multipart upload.
  • params: (array, default=array([])) Custom parameters to use with the upload. For single uploads, they must correspond to those used for the CopyObject operation. For multipart uploads, they correspond to the parameters of the CreateMultipartUpload operation.
  • part_size: (int) Part size to use when doing a multipart upload.

Parameters

string $fromBucket Bucket where the copy source resides.
string $fromKey Key of the copy source.
string $destBucket Bucket to which to copy the object.
string $destKey Key to which to copy the object.
string $acl = 'private' ACL to apply to the copy (default: private).
array $options = [] Options used to configure the upload process.

Returns

Aws\ResultInterface
Returns the result of the copy.

See

Aws\S3\MultipartCopy for more info about multipart uploads.

GuzzleHttp\Promise\PromiseInterface copyAsync ( string $fromBucket, string $fromKey, string $destBucket, string $destKey, string $acl = 'private', array $options = [] )

Copy an object of any size to a different location asynchronously.

Parameters

string $fromBucket Bucket where the copy source resides.
string $fromKey Key of the copy source.
string $destBucket Bucket to which to copy the object.
string $destKey Key to which to copy the object.
string $acl = 'private' ACL to apply to the copy (default: private).
array $options = [] Options used to configure the upload process.

Returns

GuzzleHttp\Promise\PromiseInterface

Returns a promise that will be fulfilled with the result of the copy.

See

self::copy for more info about the parameters above.

uploadDirectory ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] )

Recursively uploads all files in a given directory to a given bucket.

Parameters

string $directory Full path to a directory to upload
string $bucket Name of the bucket
string $keyPrefix = null Virtual directory key prefix to add to each upload
array $options = [] Options available in Aws\S3\Transfer::__construct

See

Aws\S3\Transfer for more options and customization

GuzzleHttp\Promise\PromiseInterface uploadDirectoryAsync ( string $directory, string $bucket, string $keyPrefix = null, array $options = [] )

Recursively uploads all files in a given directory to a given bucket.

Parameters

string $directory Full path to a directory to upload
string $bucket Name of the bucket
string $keyPrefix = null Virtual directory key prefix to add to each upload
array $options = [] Options available in Aws\S3\Transfer::__construct

Returns

GuzzleHttp\Promise\PromiseInterface

A promise that is settled when the upload is complete.

See

Aws\S3\Transfer for more options and customization

downloadBucket ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] )

Downloads a bucket to the local filesystem

Parameters

string $directory Directory to download to
string $bucket Bucket to download from
string $keyPrefix = '' Only download objects that use this key prefix
array $options = [] Options available in Aws\S3\Transfer::__construct

GuzzleHttp\Promise\PromiseInterface downloadBucketAsync ( string $directory, string $bucket, string $keyPrefix = '', array $options = [] )

Downloads a bucket to the local filesystem

Parameters

string $directory Directory to download to
string $bucket Bucket to download from
string $keyPrefix = '' Only download objects that use this key prefix
array $options = [] Options available in Aws\S3\Transfer::__construct

Returns

GuzzleHttp\Promise\PromiseInterface

A promise that is settled when the download is complete.

string determineBucketRegion ( string $bucketName )

Returns the region in which a given bucket is located.

Parameters

string $bucketName

Returns

string

GuzzleHttp\Promise\PromiseInterface determineBucketRegionAsync ( string $bucketName )

Returns a promise fulfilled with the region in which a given bucket is located.

Parameters

string $bucketName

Returns

GuzzleHttp\Promise\PromiseInterface
AWS SDK for PHP 3.x API documentation generated by ApiGen