Skip to content

Instantly share code, notes, and snippets.

@yesidays
Created January 15, 2012 05:37
Show Gist options
  • Save yesidays/1614510 to your computer and use it in GitHub Desktop.
Save yesidays/1614510 to your computer and use it in GitHub Desktop.
code.jobs - Put S3 Bucket - Codeigniter
<?php
function _puts3($filename,$type)
{
$bucketfolder = 'full';
$file = "/home/silvercorp/webapps/codejobs/tmp/".$filename;
$bucket = "silvercorp";
$uri = $bucketfolder.'/'.$filename;
$put = S3::putObject(S3::inputFile($file), $bucket, $uri, S3::ACL_PUBLIC_READ, array(), array("Cache-Control" => "max-age=315360000","Expires" => gmdate("D, d M Y H:i:s T", strtotime("+5 years"))) );
if(!$put) {
return FALSE;
} else{
return TRUE;
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment