Webiny\Component\Amazon\S3::getObject PHP Method

getObject() public method

Get object identified by bucket and key
public getObject ( string $bucket, string $key, array $params = [] ) : mixed
$bucket string
$key string
$params array
return mixed
    public function getObject($bucket, $key, array $params = [])
    {
        return $this->instance->getObject($bucket, $key, $params);
    }

Usage Example

Example #1
0
 /**
  * @inheritdoc
  */
 public function getContents($key)
 {
     $this->recentKey = $key;
     try {
         $data = (string) $this->s3Client->getObject($this->bucket, $key)['Body'];
     } catch (NoSuchKeyException $e) {
         throw new StorageException(StorageException::FAILED_TO_READ);
     }
     return $data;
 }
All Usage Examples Of Webiny\Component\Amazon\S3::getObject