Skip to content

Instantly share code, notes, and snippets.

@hamaguchi
Created May 18, 2016 09:30
Show Gist options
  • Save hamaguchi/c1ac3e047e04ab402e2e9cae66cdc8f3 to your computer and use it in GitHub Desktop.
Save hamaguchi/c1ac3e047e04ab402e2e9cae66cdc8f3 to your computer and use it in GitHub Desktop.
$s3 = new \Aws\S3\S3Client([
'version' => 'latest',
'region' => $region
]);
date_default_timezone_set("Asia/Tokyo");
// オリジナルファイル保存
$result = $s3->putObject(
array(
'Bucket' => $bucket,
'Key' => $new_filename . '.jpg',
'Body' => $image->getImageAsString(IMAGETYPE_JPEG, 80),
'ACL' => $acl,
'ContentType' => 'image/jpeg'
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment