Skip to content

Commit 2276d82

Browse files
authored
Update demo.js
1 parent d3a32d1 commit 2276d82

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

demo/demo.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -330,8 +330,8 @@ function putObject() {
330330
// 格式1. 传入文件内容
331331
// Body: fs.readFileSync(filepath),
332332
// 格式2. 传入文件流,必须需要传文件大小
333-
// Body: fs.createReadStream(filepath),
334-
// ContentLength: fs.statSync(filepath).size
333+
Body: fs.createReadStream(filepath),
334+
ContentLength: fs.statSync(filepath).size
335335
}, function (err, data) {
336336
if (err) {
337337
console.log(err);
@@ -371,10 +371,7 @@ function getObject() {
371371
Bucket: config.Bucket,
372372
Region: config.Region,
373373
Key: '1mb.zip',
374-
// 格式1. 传文件路径
375-
FilePath: filepath,
376-
// 格式2:传写文件流
377-
// Output: fs.createWriteStream(filepath)
374+
Output: fs.createWriteStream(filepath)
378375
}, function (err, data) {
379376
if (err) {
380377
return console.log(err);

0 commit comments

Comments
 (0)