支持截图,文件存储改用minio
This commit is contained in:
16
miniofile.py
Normal file
16
miniofile.py
Normal file
@@ -0,0 +1,16 @@
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user