from src.ossConfig import ossConfig
import unicloud_oss.Oss as 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' filename = 'D:\\test\\first.py' if Oss.put_object(config, bucket_name, object_name, filename): print("put object sucess!") else: print("put object failed!") # 指定对象权限上传 if Oss.put_object(config, bucket_name, object_name, filename, ACL='public-read', StorageClass='STANDARD'): print("put object sucess!") else: print("put object failed!") |