upd dev branche
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not 2023-11-15 22:30:31 +10:00
parent f37c6aeecd
commit b858c9db9d

7
app.py
View File

@ -90,7 +90,7 @@ def allowed_file(filename):
def post_to_post(post_key):
#### TODO resize pics https://stackoverflow.com/questions/53337318/how-can-i-resize-image-with-pil-on-upload-and-serve-them-with-flask-cloudy
#### TODO allow only imgs, videos, and gifs
if 'file' in request.files:
@ -100,10 +100,12 @@ def post_to_post(post_key):
files = request.files.getlist("file")
for file in files:
size = os.fstat(file.fileno()).st_size
#### работает ли??
if allowed_file(file.filename):
minioClient.put_object(
bucket_name, file.filename, file, size
)
else:
print(f'somebody tried to put this inside minio: {file.filename} size: {size}')
@ -152,6 +154,9 @@ def post_to_post(post_key):
#### TODO websockets
#### TODO kafka
#### TODO shards
#### TODO grpc
if __name__ == "__main__":
app.run(debug=True, host='0.0.0.0')