Cara mengunggah file ke alicloud oss dengan node.js dan ekspres
var co = require('co');
var OSS = require('ali-oss');
var client = new OSS({
region: '<Your region>',
accessKeyId: '<Your AccessKeyId>',
accessKeySecret: '<Your AccessKeySecret>',
bucket: 'Your bucket name'
});
co(function* () {
var result = yield client.put('object-key', new Buffer('hello world'));
console.log(result);
}).catch(function (err) {
console.log(err);
});
Quaint Quoll