17 lines
341 B
Python
17 lines
341 B
Python
from const import ENDPOINT, ACCESS_KEY, SECRET_KEY, BUCKET
|
|
from minio import Minio
|
|
|
|
client = Minio(
|
|
endpoint=ENDPOINT,
|
|
access_key=ACCESS_KEY,
|
|
secret_key=SECRET_KEY,
|
|
secure=False
|
|
)
|
|
|
|
|
|
def put_object(name, content):
|
|
length = len(content.getbuffer())
|
|
content.seek(0)
|
|
client.put_object(BUCKET, name, content, length)
|
|
|