Overview
Tencent Cloud Object Storage (COS) supports deleting one or more objects uploaded to a bucket. You can delete objects in batches through the console, API, or SDK. By default, an empty response is returned if the task deletion completes successfully. If an error occurs, an error message is returned.
Note:
A maximum of 1000 objects can be deleted per request. If needed, split the list and send the request separately.
If you select delete "folder", it will trigger simultaneous deletion of all objects under the "folder". With Versioning Not Enabled, data deletion cannot be recovered or accessed.
If versioning is enabled for your current bucket (including enabled and paused states), performing deletion operation does not actually delete the object but adds a deletion marker to the current version object. At the same time, your storage usage will not reduce. To truly delete an object, you need to specify a version ID. For more information, please refer to Version Control Overview. If you need to delete large amounts of data or nested folders, it may take a long time to complete the deletion. For such scenarios, it is recommended to set lifecycle for deletion. Applicable Scenarios
Tencent Cloud Object Storage (COS) supports directly deleting one or multiple objects. To delete an object, you only need to provide its object key and call an API request to delete it.
Usage
Using the COS Console
Deleting an Object in a Bucket with Versioning Not Enabled
2. In the left sidebar, click Bucket List to go to the bucket list page.
3. Find the bucket where the object is located and click the bucket name to enter the bucket management page.
4. In the left sidebar, select File List to go to the file list page.
5. Select one or more objects you want to delete, click More Operations > Delete at the top.
6. In the pop-up prompt window, click Delete to delete the object.
Deleting an Object in a Bucket with Versioning Enabled/Suspended
Note:
If the bucket has used the version control feature, you must specify a Version ID to actually delete an object. If you delete an object without specifying a Version ID, the object will not be actually deleted. Instead, a deletion marker will be added to the current version. For more information, please refer to Version Control Overview. 2. In the left sidebar, click Bucket List to go to the bucket list page.
3. Find the bucket where the object is located and click the bucket name to enter the bucket management page.
4. In the left sidebar, select File List to go to the file list page.
5. Turn on the "Show Noncurrent Versions" option at the top, then select one or more object versions to delete, and click More Operations > Delete at the top.
6. In the pop-up prompt window, click Delete to actually delete the object.
Using the REST API
Using SDKs
Directly call the single object deleting method in the SDK. For more information, see the SDK documentation for the corresponding programming language below: