Listing Objects
If you have any questions during development, post them on the Issues page of GitHub. For details about parameters and usage of each API, see the API Reference.
After objects are uploaded, you may want to view the objects contained in a bucket. Sample code is as follows:
obsClient.listObjects({ Bucket : 'bucketname' }, function (err, result) { if(err){ console.error('Error-->' + err); }else{ console.log('Status-->' + result.CommonMsg.Status); if(result.CommonMsg.Status < 300 && result.InterfaceResult){ for(var j in result.InterfaceResult.Contents){ console.log('Contents[' + j + ']:'); console.log('Key-->' + result.InterfaceResult.Contents[j]['Key']); console.log('LastModified-->' + result.InterfaceResult.Contents[j]['LastModified']); console.log('Size-->' + result.InterfaceResult.Contents[j]['Size']); } } } });
- In the previous sample code, 1000 objects will be listed, by default.
- For more information, see Listing Objects.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot