Skip to content

Commit fc7cc54

Browse files
committed
优化 Demo
1 parent fb83fa1 commit fc7cc54

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

demo/demo.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -808,9 +808,10 @@ function putObject() {
808808
// 格式2. 传入文件流,必须需要传文件大小
809809
Body: fs.createReadStream(filepath),
810810
ContentLength: fs.statSync(filepath).size,
811-
812-
// 万象持久化接口,上传时持久化
813-
// 'Pic-Operations': '{"is_pic_info": 1, "rules": [{"fileid": "test.jpg", "rule": "imageMogr2/thumbnail/!50p"}]}'
811+
Headers: {
812+
// 万象持久化接口,上传时持久化
813+
// 'Pic-Operations': '{"is_pic_info": 1, "rules": [{"fileid": "test.jpg", "rule": "imageMogr2/thumbnail/!50p"}]}'
814+
},
814815
}, function (err, data) {
815816
console.log(err || data);
816817
fs.unlinkSync(filepath);
@@ -1156,6 +1157,10 @@ function sliceUploadFile() {
11561157
onProgress: function (progressData) {
11571158
console.log(JSON.stringify(progressData));
11581159
},
1160+
Headers: {
1161+
// 万象持久化接口,上传时持久化
1162+
// 'Pic-Operations': '{"is_pic_info": 1, "rules": [{"fileid": "test.jpg", "rule": "imageMogr2/thumbnail/!50p"}]}'
1163+
},
11591164
}, function (err, data) {
11601165
console.log(err || data);
11611166
fs.unlinkSync(filepath);

0 commit comments

Comments
 (0)