Skip to content

Instantly share code, notes, and snippets.

@matthewfitz
Created June 22, 2010 16:02
Show Gist options
  • Save matthewfitz/448667 to your computer and use it in GitHub Desktop.
Save matthewfitz/448667 to your computer and use it in GitHub Desktop.
public function putImage($file,$uri) {
$fp = fopen($file, "rb");
$filesize = filesize($file);
$info = getimagesize($file);
$input = $this->inputResource($fp, $filesize);
$requestHeaders = array('Content-Type' => $info['mime']);
if ($this->putObject($input, $this->_bucketName, $uri, \Amazon\S3::ACL_PUBLIC_READ, array(), $requestHeaders)) {
return TRUE;
}
return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment