上传对象
开发过程中,您有任何问题可以在github上提交issue,或者在华为云对象存储服务论坛中发帖求助。接口参考文档详细介绍了每个接口的参数和使用方法。
本示例用于上传字符串“Hello OBS”到桶名为“bucketname”里,名称为“objectname”。
代码示例如下所示:
obsClient.putObject({
Bucket : 'bucketname',
Key : 'objectname',
Body : 'Hello OBS'
}, function (err, result) {
if(err){
console.error('Error-->' + err);
}else{
console.log('Status-->' + result.CommonMsg.Status);
}
});
