

UploadDirectory() method will be removed from each object key. By default, the $directory passed into the For example, you can specify an ACL key to change the ACL of each uploaded object.īase directory to remove from each object key. The uploadDirectory() method also accepts an optional associative array of $options that can be used to furtherĪrray of parameters to use with each PutObject or CreateMultipartUpload operation performed during Will be uploaded to my-bucket under the testing/ virtual folder: For example, if the $bucket name is my-bucket and the $keyPrefix is 'testing/', then your files

Public function uploadDirectory ( $directory, $bucket, $keyPrefix = null, array $options = array ())īy specifying $keyPrefix, you can cause the uploaded objects to be placed under a virtual folder in the Amazon S3īucket.

You can also create pre-signed URLs for any Amazon S3 operation using the getCommand method for creating a GuzzleĬommand object and then calling the createPresignedUrl() method on the command. This should result in a 403 since the object is private try echo $response -> getStatusCode () // > 403 // Get the contents of the object using the pre-signed URL $response = $http -> get ( $signedUrl ) -> send () echo $response -> getBody () // > Hello! Get a plain URL for an Amazon S3 object $plainUrl = $client -> getObjectUrl ( $bucket, 'data.txt' ) // > // Get a pre-signed URL for an Amazon S3 object $signedUrl = $client -> getObjectUrl ( $bucket, 'data.txt', '+10 minutes' ) // > &Expires=&Signature= // Create a vanilla Guzzle HTTP client for accessing the URLs $http = new \Guzzle\Http\Client // Try to get the plain URL.
