Upyun storage client
该SDK用于访问和调用又拍云存储空间。使用本SDK前,请自行申请又拍云的使用权限,以及得到操作员账号。
本SDK已完成如下功能:
$ npm install upyun-storage
var upyun = require('upyun-storage');
// 创建客户端
var client = upyun.create('oprator', 'password', 'bucket');
// 上传文件
client.putFile('/path/to/file.jpg', '/file.jpg', function (err, data, res) {
if (err) {
console.log('出现错误: ' + err.message);
return;
}
console.log('上传成功');
});
// 下载文件
client.putFile('/path/to/file.jpg', '/file.jpg', function (err, data, res) {
if (err) {
console.log('出现错误: ' + err.message);
return;
}
console.log('上传成功');
});
The MIT License. feel free to use it.