module/FzyCommon/src/FzyCommon/Service/Url.php
public function fromS3($key, $expiration = null, $downloadAs = null)
    {
        $args = array();
        if (!empty($downloadAs)) {
            if (empty($expiration)) {
                throw new \RuntimeException("Unable to set download name on URL without expiration.");
            }
            $args['ResponseContentDisposition'] = 'attachment;filename='.$downloadAs;
        }

        return $this->getServiceLocator()->get('FzyCommon\Service\Aws\S3')->getObjectUrl($this->getServiceLocator()->get('FzyCommon\Service\Aws\S3\Config')->get('bucket'), $key, $expiration, $args);
    }
public function fromS3($key, $expiration = null, $downloadAs = null)
    {
        $args = array();
        if (!empty($downloadAs)) {
            if (empty($expiration)) {
                throw new \RuntimeException("Unable to set download name on URL without expiration.");
            }
            $args['ResponseContentDisposition'] = 'attachment;filename='.$downloadAs;
        }

        return $this->getServiceLocator()->get('FzyCommon\Service\Aws\S3')->getObjectUrl($this->getServiceLocator()->get('FzyCommon\Service\Aws\S3\Config')->get('bucket'), $key, $expiration, $args);
    }
Returns the S3 URL for the file at the specified key.
expiration determines how long the URL will work
downlaodAs specifies what the file name should start as when downloading
@param $key
@param  null   $expiration
@param  null   $downloadAs
@return string