diff --git a/src/Storage/StorageObject.php b/src/Storage/StorageObject.php index 0ce3e9f6c6c1..45ed1b90bd1f 100644 --- a/src/Storage/StorageObject.php +++ b/src/Storage/StorageObject.php @@ -536,13 +536,7 @@ public function rename($name, array $options = []) */ public function downloadAsString(array $options = []) { - return (string) $this->connection->downloadObject( - $this->formatEncryptionHeaders( - $options - + $this->encryptionData - + $this->identity - ) - ); + return (string) $this->downloadAsStream($options); } /** @@ -573,13 +567,7 @@ public function downloadToFile($path, array $options = []) $destination = Psr7\stream_for(fopen($path, 'w')); Psr7\copy_to_stream( - $this->connection->downloadObject( - $this->formatEncryptionHeaders( - $options - + $this->encryptionData - + $this->identity - ) - ), + $this->downloadAsStream($options), $destination );