Aws\S3\S3Client::getObjectUrl PHP Method

getObjectUrl() public method

public getObjectUrl ( $bucket, $key )
    public function getObjectUrl($bucket, $key)
    {
        $command = $this->getCommand('GetObject', ['Bucket' => $bucket, 'Key' => $key]);
        return (string) \Aws\serialize($command)->getUri();
    }

Usage Example

 /**
  * Returns the URL to an object identified by its bucket and key.
  *
  * The URL returned by this method is not signed nor does it ensure the the
  * bucket and key given to the method exist. If you need a signed URL, then
  * use the {@see \Aws\S3\S3Client::createPresignedRequest} method and get
  * the URI of the signed request.
  *
  * @param string $bucket  The name of the bucket where the object is located
  * @param string $key     The key of the object
  *
  * @return string The URL to the object
  */
 public function getObjectUrl($site, $key)
 {
     $config = $this->_config;
     $bucket = $config['bucket'];
     $builtBucket = strlen($bucket) > 0 ? $site . '.' . $bucket : $site;
     return $this->_s3Client->getObjectUrl($builtBucket, $key);
 }
All Usage Examples Of Aws\S3\S3Client::getObjectUrl