SDK参考 -》python->上传文件-》简单上传
# -*- coding: utf-8 -*-
import oss2
auth=oss2.Auth('<yourAccessKeyID>','<yourAccessKeySecret>')
bucket = oss2.Bucket(auth,'http://oss-cn-hangzhou.aliyuncs.com','<yourBucketName>')
#必须以二进制的方式打开文件,因为需要知道文件包含的字节数
with open('<yourLocalFile>','rb') as fileobj:
fileobj.seek(1000,os.SEEK_SET)
current =fileobj.tell()
bucket.put_object('<yourObjectName>',fileobj)