Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

How To Upload File To Alicloud OSS with node.js and Express

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);
});
Source by www.alibabacloud.com #
 
PREVIOUS NEXT
Tagged: #How #To #Upload #File #To #Alicloud #OSS #Express
ADD COMMENT
Topic
Name
8+8 =