Help Center/ Object Storage Service/ BrowserJS SDK Developer Guide (Ally Region)/ Quick Start/ Deleting an Object
Updated on 2026-01-16 GMT+08:00
Deleting an Object
This example deletes object objectname from bucket bucketname.
The example code is as follows:
obsClient.deleteObject({
Bucket : 'bucketname',
Key : 'objectname'
}, function (err, result) {
if(err){
console.error('Error-->' + err);
}else{
console.log('Status-->' + result.CommonMsg.Status);
}
});
- This example only deletes a single object. To delete objects in a batch, traverse objects and list to-be-deleted objects on your own.
- For details about deletion, see Deleting Objects.
Parent topic: Quick Start
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot