Uprava nahravani, zmeny v modelech
This commit is contained in:
+5
-2
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user