I believe you needed this since you reached this page haha !

There you go :

<?php

$aws_access_key_id = '';
$aws_secret_key = '';
$aws_bucket = '';
$file_path = '';
$timeout = '+10 minutes';

// get the URL!
$url = get_public_url($aws_access_key_id,$aws_secret_key,$aws_bucket,$file_path,$timeout);

// print the URL!
echo($url);



function get_public_url($keyID, $s3Key, $bucket, $filepath, $timeout)
{
    $expires = strtotime($timeout);
    $stringToSign = "GET\n\n\n{$expires}\n/{$bucket}/{$filepath}";       
    $signature = urlencode(hex2b64(hmacsha1($s3Key, utf8_encode($stringToSign))));

    $url = "https://{$bucket}.s3.amazonaws.com/{$filepath}?AWSAccessKeyId={$keyID}&Signature={$signature}&Expires={$expires}";
    return $url;
}

function hmacsha1($key,$data)
{
    $blocksize=64;
    $hashfunc='sha1';
    if (strlen($key)>$blocksize)
        $key=pack('H*', $hashfunc($key));
    $key=str_pad($key,$blocksize,chr(0x00));
    $ipad=str_repeat(chr(0x36),$blocksize);
    $opad=str_repeat(chr(0x5c),$blocksize);
    $hmac = pack(
        'H*',$hashfunc(
            ($key^$opad).pack(
                'H*',$hashfunc(
                    ($key^$ipad).$data

                    )
                )
            )
        );
    return bin2hex($hmac);
}

function hex2b64($str)
{
  $raw = '';
  for ($i=0; $i < strlen($str); $i+=2)
  {
      $raw .= chr(hexdec(substr($str, $i, 2)));
  }
  return base64_encode($raw);
}
?>

 

Keep it real ,
Best Regards ,Alin Razvan
I'm a small fish in a big ocean , trying to make a difference and some waves while swimming my way through .