Skip to content

Commit bf93463

Browse files
committed
Add read support
Add support using the client to read and return a file.
1 parent 6bd5f64 commit bf93463

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/BackblazeAdapter.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,14 @@ public function updateStream($path, $resource, Config $config)
8686
*/
8787
public function read($path)
8888
{
89-
return false;
89+
$file = $this->getClient()->getFile([
90+
'BucketName' => $this->bucketName,
91+
'FileName' => $path
92+
]);
93+
$fileContent = $this->getClient()->download([
94+
'FileId' => $file->getId()
95+
]);
96+
return ['contents' => $fileContent];
9097
}
9198

9299
/**

0 commit comments

Comments
 (0)