Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
guoxiangke committed Jan 13, 2022
1 parent 5d4152c commit 4665d1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Upyun/Uploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct(Config $config)

public function upload($path, $file, $params, $withAsyncProcess)
{
$stream = Psr7\stream_for($file);
$stream = \GuzzleHttp\Psr7\Utils::streamFor($file);
$size = $stream->getSize();
$useBlock = $this->needUseBlock($size);

Expand Down Expand Up @@ -87,7 +87,7 @@ private function pointUpload($path, $stream, $params)
'X-Upyun-Multi-Uuid' => $uuid,
'X-Upyun-Part-Id' => $partId
))
->withFile(Psr7\stream_for($fileBlock))
->withFile(\GuzzleHttp\Psr7\Utils::streamFor($fileBlock))
->send();

if ($res->getStatusCode() !== 204) {
Expand Down Expand Up @@ -167,7 +167,7 @@ private function concurrentPointUpload($path, $stream, $params)
'X-Upyun-Multi-Uuid' => $uuid,
'X-Upyun-Part-Id' => $i
))
->withFile(Psr7\stream_for($fileBlock))
->withFile(\GuzzleHttp\Psr7\Utils::streamFor($fileBlock))
->toRequest();
}
};
Expand Down

0 comments on commit 4665d1a

Please sign in to comment.