@@ -144,6 +144,7 @@ options:
144
144
145
145
- accessKeyId {String} access key you create on aliyun console website
146
146
- accessKeySecret {String} access secret you create
147
+ - [ stsToken] {String} used by temporary authorization, detail [ see] ( https://www.alibabacloud.com/help/doc-detail/32077.htm )
147
148
- [ bucket] {String} the default bucket you want to access
148
149
If you don't have any bucket, please use ` putBucket() ` create one first.
149
150
- [ endpoint] {String} oss region domain. It takes priority over ` region ` .
@@ -1534,7 +1535,7 @@ parameters:
1534
1535
- [ options] {Object} optional args
1535
1536
- [ parallel] {Number} the number of parts to be uploaded in parallel
1536
1537
- [ partSize] {Number} the suggested size for each part
1537
- - [ progress] {Function} the progress callback called after each
1538
+ - [ progress] {Function} thunk or generator, the progress callback called after each
1538
1539
successful upload of one part, it will be given three parameters:
1539
1540
(percentage {Number}, checkpoint {Object}, res {Object})
1540
1541
- [ checkpoint] {Object} the checkpoint to resume upload, if this is
@@ -1581,14 +1582,45 @@ var result = yield store.multipartUpload('object', '/tmp/file', {
1581
1582
1582
1583
var result = yield store .multipartUpload (' object' , ' /tmp/file' , {
1583
1584
checkpoint: savedCpt,
1584
- progress : function * (p , cpt , res ) {
1585
+ progress : function * (p , cpt , res ) { // progress is generator
1585
1586
console .log (p);
1586
1587
console .log (cpt);
1587
1588
console .log (res .headers [' x-oss-request-id' ]);
1588
1589
}
1589
1590
});
1590
1591
1591
1592
```
1593
+
1594
+ - multipartUpload progress example
1595
+
1596
+ ``` js
1597
+ // thunk
1598
+ function thunkProgress (p , cpt , res ) {
1599
+ return function (done ) {
1600
+ console .log (p);
1601
+ console .log (cpt);
1602
+ console .log (res .headers [' x-oss-request-id' ]);
1603
+ done ();
1604
+ }
1605
+ }
1606
+
1607
+ var result1 = yield store .multipartUpload (' object' , ' /tmp/file' , {
1608
+ progress: thunkProgress
1609
+ });
1610
+
1611
+ // generator
1612
+ function * generatorProgress (p , cpt , res ) {
1613
+ console .log (p);
1614
+ console .log (cpt);
1615
+ console .log (res .headers [' x-oss-request-id' ]);
1616
+ }
1617
+
1618
+ var result2 = yield store .multipartUpload (' object' , ' /tmp/file' , {
1619
+ progress: generatorProgress
1620
+ });
1621
+
1622
+ ```
1623
+
1592
1624
- multipartUpload with cancel
1593
1625
1594
1626
> tips: cancel multipartUpload, now only support browser.
0 commit comments