• Object Storage Service

obs
  1. Help Center
  2. Object Storage Service
  3. Developer Guide (Node.js SDK)
  4. Quick Start
  5. Downloading an Object

Downloading an Object

Sample code:

obsClient.getObject({
       Bucket : 'bucketname',
       Key : 'objectkey'
}, (err, result) => {
       if(err){
              console.error('Error-->' + err);
       }else{
              console.log('Status-->' + result.CommonMsg.Status);
              if(result.CommonMsg.Status < 300 && result.InterfaceResult){
                     console.log(result.InterfaceResult.Content.toString());
              }
       }
});
NOTE:

For more information, see Object Download.