Skip to content

Commit

Permalink
Fixed writeStream error
Browse files Browse the repository at this point in the history
  • Loading branch information
zgldh committed Mar 1, 2022
1 parent b4838a3 commit b92345f
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/QiniuAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,7 @@ public function writeStream(string $path, $contents, Config $config): void
$mime = $config->get('mime', 'application/octet-stream');
$checkCrc = $config->get('checkCrc', false);

$resourceData = '';
while (!feof($contents)) {
$resourceData = $resourceData . fread($contents, 1024);
}

[$ret, $error] = $this->qiniuPutFile($token, $path, $resourceData, $params, $mime, $checkCrc);
[$ret, $error] = $this->qiniuPutFile($token, $path, $contents, $params, $mime, $checkCrc);

if ($error !== null) {
$this->logQiniuError($error);
Expand Down

0 comments on commit b92345f

Please sign in to comment.