Skip to content

Instantly share code, notes, and snippets.

@slav123
Created October 5, 2012 07:00
Show Gist options
  • Save slav123/3838471 to your computer and use it in GitHub Desktop.
Save slav123/3838471 to your computer and use it in GitHub Desktop.
AmazonS3 PHP create object
include_once('application/libraries/aws/sdk.class.php');
// Instantiate the AmazonS3 class
$this->s3 = new AmazonS3();
$bucket = '';
$body = 'aaa';
$response = $this->s3->create_object($bucket, $this->_feed, array(
'body' => gzencode($body, 9),
'contentType' => 'application/json',
'acl' => AmazonS3::ACL_PUBLIC,
'headers' => array('Content-Encoding' => 'gzip')
));
// Success?
if ( ! $response->isOK()) {
$this->data['message'] .= print_r($response, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment