From ea6533db4e56ab516beb4e80e3274a41b8c9db2a Mon Sep 17 00:00:00 2001 From: ManishMadan2882 Date: Thu, 8 May 2025 00:11:02 +0530 Subject: [PATCH] (fix:attachment) strictly use filename --- application/api/user/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/api/user/routes.py b/application/api/user/routes.py index 606f6cd3..1ca8fc32 100644 --- a/application/api/user/routes.py +++ b/application/api/user/routes.py @@ -2978,7 +2978,7 @@ class StoreAttachment(Resource): try: attachment_id = ObjectId() - original_filename = secure_filename(file.filename) + original_filename = secure_filename(os.path.basename(file.filename)) relative_path = f"{settings.UPLOAD_FOLDER}/{user}/attachments/{str(attachment_id)}/{original_filename}" metadata = storage.save_file(file, relative_path)