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
<?php | |
function AWS_S3_PresignDownload($AWSAccessKeyId, $AWSSecretAccessKey, $BucketName, $AWSRegion, $canonical_uri, $expires = 8400) { | |
// Creates a signed download link for an AWS S3 file | |
// Based on https://gist.github.com/kelvinmo/d78be66c4f36415a6b80 | |
$encoded_uri = str_replace('%2F', '/', rawurlencode($canonical_uri)); | |
// Specify the hostname for the S3 endpoint | |
if($AWSRegion == 'us-east-1') { |