Created
January 15, 2012 05:37
-
-
Save yesidays/1614510 to your computer and use it in GitHub Desktop.
code.jobs - Put S3 Bucket - Codeigniter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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