cos-nodejs-sdk-v5
Advanced tools
Comparing version 2.0.2 to 2.0.3
@@ -11,3 +11,8 @@ var fs = require('fs'); | ||
SecretKey: config.SecretKey, | ||
ProgressInterval: 1000, | ||
FileParallelLimit: 3, | ||
ChunkParallelLimit: 3, | ||
ChunkSize: 1024 * 1024, | ||
}); | ||
var TaskId; | ||
@@ -283,2 +288,5 @@ function getService() { | ||
Key: filename, /* 必须 */ | ||
TaskReady: function (tid) { | ||
TaskId = tid; | ||
}, | ||
onProgress: function (progressData) { | ||
@@ -425,3 +433,2 @@ console.log(JSON.stringify(progressData)); | ||
var TaskId | ||
function sliceUploadFile() { | ||
@@ -428,0 +435,0 @@ // 创建测试文件 |
{ | ||
"name": "cos-nodejs-sdk-v5", | ||
"version": "2.0.2", | ||
"version": "2.0.3", | ||
"description": "cos nodejs sdk v5", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -85,3 +85,3 @@ var fs = require('fs'); | ||
size = params.Body.length; | ||
} else if (params.ContentLength === undefined) { | ||
} else if (params.ContentLength !== undefined) { | ||
size = params.ContentLength; | ||
@@ -88,0 +88,0 @@ } else if (params.FilePath) { |
@@ -8,2 +8,10 @@ 'use strict'; | ||
function camSafeUrlEncode(str) { | ||
return encodeURIComponent(str) | ||
.replace(/!/g, '%21') | ||
.replace(/'/g, '%27') | ||
.replace(/\(/g, '%28') | ||
.replace(/\)/g, '%29') | ||
.replace(/\*/g, '%2A'); | ||
} | ||
@@ -43,4 +51,4 @@ //测试用的key后面可以去掉 | ||
key = key.toLowerCase(); | ||
key = encodeURIComponent(key); | ||
list.push(key + '=' + encodeURIComponent(val)); | ||
key = camSafeUrlEncode(key); | ||
list.push(key + '=' + camSafeUrlEncode(val)); | ||
} | ||
@@ -47,0 +55,0 @@ return list.join('&'); |
Sorry, the diff of this file is too big to display
176178
4446