Created
January 10, 2012 03:08
-
-
Save pmeissner/1586631 to your computer and use it in GitHub Desktop.
This file contains 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
<? | |
public static function generate_url($file_key) { | |
$s3 = self::get_s3(); | |
$link = ArclightAWSExpiring_Link::create()->where('file_key = ?', $file_key)->find(); | |
if (!$link) | |
throw new Phpr_ApplicationException('We are sorry, but the link could not be found'); | |
return $s3->get_object_url(self::$configuration->bucket, $file_key, '10 Seconds', | |
array('response' => array('content-disposition' => 'attachment; filename=' . $link->file_name)) | |
); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment