we can send now?
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Simple_Not
2023-07-20 01:24:15 +10:00
parent 8d98c04fa3
commit 5938f4e063
4 changed files with 136 additions and 37 deletions

33
app.py
View File

@@ -5,8 +5,10 @@ from todo import todos
from threads import threads_lists
from threads_with_posts import open_threads
from arango import ArangoClient
from minio import minioClient
import socket, os
import socket
app = Flask(__name__)
@@ -176,7 +178,34 @@ def post_to_post(post_key):
# def post_a_file():
# pass
@app.route("/send_dudes", methods=["POST"])
def upload_file():
if request.method == "POST":
uploaded_file = request.files["file"]
if uploaded_file:
bucket_name = "thread-pics"
size = os.fstat(uploaded_file.fileno()).st_size
minioClient.put_object(
bucket_name, uploaded_file.filename, uploaded_file, size
)
return """
<h1>stored</h1>
<form method=post enctype=multipart/form-data>
<input type=file name=file>
<input type=submit value=Upload>
</form>
"""
return """
<h1>Upload IPS File</h1>
<form method=post enctype=multipart/form-data>
<input type=file name=file>
<input type=submit value=Upload>
</form>
"""
if __name__ == "__main__":