Skip to content

Commit

Permalink
修复 test-123-1250000000 bucket 分片上传出错问题
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Jan 12, 2018
1 parent 66aaf0f commit e8de0e8
Show file tree
Hide file tree
Showing 9 changed files with 35 additions and 96 deletions.
3 changes: 2 additions & 1 deletion demo/demo.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@ function getAuth() {
var key = '1mb.zip';
var auth = cos.getAuth({
Method: 'get',
Key: key
Key: key,
Expires: 60,
});
// 注意:这里的 Bucket 格式是 test-1250000000
console.log('http://' + config.Bucket + '.cos.' + config.Region + '.myqcloud.com' + '/' + key + '?sign=' + encodeURIComponent(auth));
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cos-nodejs-sdk-v5",
"version": "2.2.3",
"version": "2.2.4",
"description": "cos nodejs sdk v5",
"main": "index.js",
"scripts": {
Expand Down
18 changes: 0 additions & 18 deletions sdk/advance.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ function sliceUploadFile(params, callback) {
var Region = params.Region;
var Key = params.Key;
var FilePath = params.FilePath;
var AppId = params.AppId;
var SliceSize = params.SliceSize || this.options.ChunkSize;
var AsyncLimit = params.AsyncLimit;
var StorageClass = params.StorageClass || 'Standard';
Expand All @@ -38,7 +37,6 @@ function sliceUploadFile(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
UploadId: data.UploadId,
SliceList: data.SliceList
}, function (err, data) {
Expand All @@ -57,7 +55,6 @@ function sliceUploadFile(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
FilePath: FilePath,
FileSize: FileSize,
SliceSize: SliceSize,
Expand All @@ -82,7 +79,6 @@ function sliceUploadFile(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
StorageClass: StorageClass,
FilePath: FilePath,
FileSize: FileSize,
Expand Down Expand Up @@ -117,7 +113,6 @@ function getUploadIdAndPartList(params, callback) {
var Bucket = params.Bucket;
var Region = params.Region;
var Key = params.Key;
var AppId = params.AppId;
var StorageClass = params.StorageClass;
var self = this;

Expand Down Expand Up @@ -234,7 +229,6 @@ function getUploadIdAndPartList(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
StorageClass: StorageClass,
});
self.multipartInit(_params, function (err, data) {
Expand All @@ -258,7 +252,6 @@ function getUploadIdAndPartList(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
UploadId: UploadId,
}, function (err, PartListData) {
if (!self._isRunningTask(TaskId)) return;
Expand Down Expand Up @@ -298,7 +291,6 @@ function getUploadIdAndPartList(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId
}, function (err, data) {
if (!self._isRunningTask(TaskId)) return;
if (err) {
Expand All @@ -324,7 +316,6 @@ function wholeMultipartList(params, callback) {
var sendParams = {
Bucket: params.Bucket,
Region: params.Region,
AppId: params.AppId,
Prefix: params.Key
};
var next = function () {
Expand All @@ -351,7 +342,6 @@ function wholeMultipartListPart(params, callback) {
Bucket: params.Bucket,
Region: params.Region,
Key: params.Key,
AppId: params.AppId,
UploadId: params.UploadId
};
var next = function () {
Expand Down Expand Up @@ -385,7 +375,6 @@ function uploadSliceList(params, cb) {
var Bucket = params.Bucket;
var Region = params.Region;
var Key = params.Key;
var AppId = params.AppId;
var UploadData = params.UploadData;
var FileSize = params.FileSize;
var SliceSize = params.SliceSize;
Expand All @@ -412,7 +401,6 @@ function uploadSliceList(params, cb) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
SliceSize: SliceSize,
FileSize: FileSize,
PartNumber: PartNumber,
Expand Down Expand Up @@ -453,7 +441,6 @@ function uploadSliceItem(params, callback) {
var Bucket = params.Bucket;
var Region = params.Region;
var Key = params.Key;
var AppId = params.AppId;
var FileSize = params.FileSize;
var FilePath = params.FilePath;
var PartNumber = params.PartNumber * 1;
Expand Down Expand Up @@ -483,7 +470,6 @@ function uploadSliceItem(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
ContentLength: ContentLength,
ContentSha1: ContentSha1,
PartNumber: PartNumber,
Expand Down Expand Up @@ -511,7 +497,6 @@ function uploadSliceComplete(params, callback) {
var Bucket = params.Bucket;
var Region = params.Region;
var Key = params.Key;
var AppId = params.AppId;
var UploadId = params.UploadId;
var SliceList = params.SliceList;
var self = this;
Expand All @@ -526,7 +511,6 @@ function uploadSliceComplete(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
UploadId: UploadId,
Parts: Parts
}, function (err, data) {
Expand All @@ -548,7 +532,6 @@ function abortUploadTask(params, callback) {
var Bucket = params.Bucket;
var Region = params.Region;
var Key = params.Key;
var AppId = params.AppId;
var UploadId = params.UploadId;
var Level = params.Level || 'task';
var AsyncLimit = params.AsyncLimit;
Expand All @@ -566,7 +549,6 @@ function abortUploadTask(params, callback) {
Bucket: Bucket,
Region: Region,
Key: Key,
AppId: AppId,
AsyncLimit: AsyncLimit,
AbortArray: AbortArray
}, function (err, data) {
Expand Down
Loading

0 comments on commit e8de0e8

Please sign in to comment.