From 2a4fbf363e8ea6bd78115dd35e7f9267211381c7 Mon Sep 17 00:00:00 2001 From: Philip Cheung Date: Tue, 8 Oct 2024 10:45:22 +0800 Subject: [PATCH] sdfsdf --- backend/app/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/utils.py b/backend/app/utils.py index 958f7a8..bb19c62 100644 --- a/backend/app/utils.py +++ b/backend/app/utils.py @@ -219,8 +219,8 @@ def delete_file(file_name, bucket_name, object_name=None): if object_name is None: object_name = file_name try: - #r2.delete_object(bucket_name, file_name) - r2.Object(bucket_name, file_name).delete() + r2.delete_object(Bucket=bucket_name, Key=file_name) + except ClientError as e: print(f"An error occurred: {e}") return False