python 代码示例如下
import oss2
................. 省略代码
for param in (access_key_id, access_key_secret, bucket_name, endpoint):
assert '<' not in param, '请设置参数:' + param
bucket = oss2.Bucket(oss2.Auth(access_key_id, access_key_secret), endpoint, bucket_name)
with open(oss2.to_unicode(src_name), 'rb') as f:
bucket.put_object(det_name, f,headers={"Cache-Control":"max-age=2592000"})
bucket.put_object(det_name, f,headers={“Cache-Control”:”max-age=2592000″})