Uprava nahravani, zmeny v modelech

This commit is contained in:
Michal Kváček
2023-06-27 22:45:03 +02:00
parent 1cf1f84e92
commit ba5c3b6a49
9 changed files with 124 additions and 17 deletions
+5 -2
View File
@@ -9,7 +9,7 @@ def check_directories(path: str):
os.makedirs(path)
async def handle_img_upload(file: Upload, path: str):
async def handle_file_upload(file: Upload, path: str):
check_directories(path)
filename = f"{uuid.uuid4()}-{file.filename}"
@@ -19,5 +19,8 @@ async def handle_img_upload(file: Upload, path: str):
image.write(content)
image.close()
return filename
def delete_file(path: str, silent: bool = False):
os.remove(path)
os.remove(path)