Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Qiniu/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

final class Config
{
const SDK_VER = '7.0.6';
const SDK_VER = '7.0.7';

const BLOCK_SIZE = 4194304; //4*1024*1024 分块上传块大小,该参数为接口规格,不能修改

Expand Down
3 changes: 0 additions & 3 deletions src/Qiniu/Storage/ResumeUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ public function upload()
$blockSize = $this->blockSize($uploaded);
$data = fread($this->inputStream, $blockSize);
if ($data === false) {
fclose($this->inputStream);
throw new \Exception("file read failed", 1);
}
$crc = \Qiniu\crc32_data($data);
Expand All @@ -85,13 +84,11 @@ public function upload()
}

if (! $response->ok() || !isset($ret['crc32'])|| $crc != $ret['crc32']) {
fclose($this->inputStream);
return array(null, new Error($this->currentUrl, $response));
}
array_push($this->contexts, $ret['ctx']);
$uploaded += $blockSize;
}
fclose($this->inputStream);
return $this->makeFile();
}

Expand Down
4 changes: 3 additions & 1 deletion src/Qiniu/Storage/UploadManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@ public function putFile(
$mime,
$this->config
);
return $up->upload();
$ret = $up->upload();
fclose($file);
return $ret;
}

public static function trimParams($params)
Expand Down
2 changes: 1 addition & 1 deletion tests/Qiniu/Tests/ResumeUpTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function test4ML()
public function test4ML2()
{
$key = 'resumePutFile4ML';
$zone = new Zone('http://up.fake.com', 'http://up.qiniu.com');
$zone = new Zone('http://up.fake.qiniu.com', 'http://up.qiniu.com');
$cfg = new Config($zone);
$upManager = new UploadManager($cfg);
$token = $this->auth->uploadToken($this->bucketName, $key);
Expand Down