Python_minio

from minio import Minio
from minio.error import (ResponseError, BucketAlreadyOwnedByYou,
                         BucketAlreadyExists)

# 使用endpoint、access key和secret key来初始化minioClient对象。
minioClient = Minio('192.168.31.217:9000',
                    access_key='minioadmin',
                    secret_key='xxxxxxxx',
                    secure=False)
try:
    minioClient.fput_object('pictures', '4.jpg', "D:/Pycharmproject2020/Django_project/django_learn/chapter06/uploadfile_demo/4.jpg")
    print('成功')
except ResponseError as err:
    print(err)