@@ -4,18 +4,18 @@ var util = require('./util');
4
4
5
5
// 文件分块上传全过程,暴露的分块上传接口
6
6
function sliceUploadFile ( params , callback ) {
7
+ var self = this ;
7
8
var ep = new EventProxy ( ) ;
8
9
var TaskId = params . TaskId ;
9
10
var Bucket = params . Bucket ;
10
11
var Region = params . Region ;
11
12
var Key = params . Key ;
12
13
var Body = params . Body ;
13
- var ChunkSize = params . ChunkSize || params . SliceSize || this . options . ChunkSize ;
14
+ var ChunkSize = params . ChunkSize || params . SliceSize || self . options . ChunkSize ;
14
15
var AsyncLimit = params . AsyncLimit ;
15
16
var StorageClass = params . StorageClass || 'Standard' ;
16
17
var ServerSideEncryption = params . ServerSideEncryption ;
17
18
var FileSize ;
18
- var self = this ;
19
19
20
20
var onProgress ;
21
21
var onHashProgress = params . onHashProgress ;
@@ -134,7 +134,7 @@ function sliceUploadFile(params, callback) {
134
134
var AutoChunkSize = 1024 * 1024 ;
135
135
for ( var i = 0 ; i < SIZE . length ; i ++ ) {
136
136
AutoChunkSize = SIZE [ i ] * 1024 * 1024 ;
137
- if ( FileSize / AutoChunkSize <= 1024 ) break ;
137
+ if ( FileSize / AutoChunkSize <= self . options . MaxPartNumber ) break ;
138
138
}
139
139
params . ChunkSize = params . SliceSize = ChunkSize = Math . max ( ChunkSize , AutoChunkSize ) ;
140
140
} ) ( ) ;
@@ -1033,7 +1033,7 @@ function sliceCopyFile(params, callback) {
1033
1033
var AutoChunkSize = 1024 * 1024 ;
1034
1034
for ( var i = 0 ; i < SIZE . length ; i ++ ) {
1035
1035
AutoChunkSize = SIZE [ i ] * 1024 * 1024 ;
1036
- if ( FileSize / AutoChunkSize <= 1024 ) break ;
1036
+ if ( FileSize / AutoChunkSize <= self . options . MaxPartNumber ) break ;
1037
1037
}
1038
1038
params . ChunkSize = ChunkSize = Math . max ( ChunkSize , AutoChunkSize ) ;
1039
1039
0 commit comments