qn icon indicating copy to clipboard operation
qn copied to clipboard

怎么和express配合上传啊

Open aa403210842 opened this issue 9 years ago • 0 comments

初始化

var qn = require('qn');
var client = qn.create({
  accessKey: 'your access key',
  secretKey: 'your secret key',
  bucket: 'your bucket name',
  domain: 'http://{bucket}.u.qiniudn.com',
  // timeout: 3600000, // default rpc timeout: one hour, optional
  // if your app outside of China, please set `uploadURL` to `http://up.qiniug.com/`
  // uploadURL: 'http://up.qiniu.com/',
});

下面对吗

exports.upload = function(req, res ){
  client.upload(req, function(err, result){
     ...
  });
}

aa403210842 avatar Sep 17 '15 03:09 aa403210842