文档中心 > 删除文件
删除文件

最近更新时间:2022-07-25

本文介绍如何删除对象。

删除桶内的单个对象或者多个对象:

from ossConfig import ossConfig

import Oss

access_key = 'youraccesskey'
secret_key = 'yoursecretkey'
endpoint_url = 'http://XXXXXXXXXXXXXXXXX.com'
config = ossConfig(access_key,secret_key,endpoint_url)

bucket_name = 'test1'
object_name = 'mytestput'

if Oss.delete_object(config, bucket_name, object_name):
   print("delete sucess!")
else:
   print("delete failed!")