Skip to content

Commit

Permalink
修复上传文件时,返回字段不一致的问题。
Browse files Browse the repository at this point in the history
  • Loading branch information
richardyao committed Jan 9, 2017
1 parent 750522e commit 77ae28c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion qcloudcos/conf.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class Conf {
// Cos php sdk version number.
const VERSION = 'v4.2.1';
const VERSION = 'v4.2.2';
const API_COSAPI_END_POINT = 'http://region.file.myqcloud.com/files/v2/';

// Please refer to http://console.qcloud.com/cos to fetch your app_id, secret_id and secret_key.
Expand Down
14 changes: 7 additions & 7 deletions qcloudcos/cosapi.php
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ private static function uploadBySlicing(
return array(
'code' => $sliceUploading->getLastErrorCode(),
'message' => $sliceUploading->getLastErrorMessage(),
'requestId' => $sliceUploading->getRequestId(),
'request_id' => $sliceUploading->getRequestId(),
);
}
}
Expand All @@ -341,26 +341,26 @@ private static function uploadBySlicing(
return array(
'code' => $sliceUploading->getLastErrorCode(),
'message' => $sliceUploading->getLastErrorMessage(),
'requestId' => $sliceUploading->getRequestId(),
'request_id' => $sliceUploading->getRequestId(),
);
}

if (!$sliceUploading->finishUploading()) {
return array(
'code' => $sliceUploading->getLastErrorCode(),
'message' => $sliceUploading->getLastErrorMessage(),
'requestId' => $sliceUploading->getRequestId(),
'request_id' => $sliceUploading->getRequestId(),
);
}

return array(
'code' => 0,
'message' => 'success',
'requestId' => $sliceUploading->getRequestId(),
'request_id' => $sliceUploading->getRequestId(),
'data' => array(
'accessUrl' => $sliceUploading->getAccessUrl(),
'resourcePath' => $sliceUploading->getResourcePath(),
'sourceUrl' => $sliceUploading->getSourceUrl(),
'access_url' => $sliceUploading->getAccessUrl(),
'resource_path' => $sliceUploading->getResourcePath(),
'source_url' => $sliceUploading->getSourceUrl(),
),
);
}
Expand Down

0 comments on commit 77ae28c

Please sign in to comment.