0.0.4 • Published 10 years ago
upyun-storage v0.0.4
upyun-storage (又拍云存储Node SDK)
该SDK用于访问和调用又拍云存储空间。使用本SDK前,请自行申请又拍云的使用权限,以及得到操作员账号。
Features
本SDK已完成如下功能:
文件功能
图片处理接口
Installation
$ npm install upyun-storage
Usage
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('上传成功');
});
License
The MIT License. feel free to use it.