Skip to content

read from oss add prefix #85

@jinmingjiaoyu

Description

@jinmingjiaoyu

public function readStream(string $path)
{
$stream = fopen('php://temp', 'w+b');
$path = $this->prefixer->prefixPath($path);
try {
fwrite($stream, $this->client->getObject($this->bucket, $path, [OssClient::OSS_FILE_DOWNLOAD => $stream]));
} catch (OssException $exception) {
fclose($stream);
throw UnableToReadFile::fromLocation($path, $exception->getMessage());
}
rewind($stream);

    return $stream;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions