Refaktoring a bugfixing

This commit is contained in:
Michal Kváček
2023-10-13 23:24:53 +02:00
parent ce2c023eaf
commit 7f7f79dad6
36 changed files with 698 additions and 722 deletions
+17
View File
@@ -0,0 +1,17 @@
import uuid
from strawberry.file_uploads import Upload
from utils.file import check_directories
async def handle_file_upload(file: Upload, path: str) -> str:
check_directories(path)
filename = f"{uuid.uuid4()}-{file.filename}"
content = await file.read()
image = open(path + "/" + filename, "wb")
image.write(content)
image.close()
return filename