diff --git a/autogpt_platform/backend/backend/api/features/workspace/routes.py b/autogpt_platform/backend/backend/api/features/workspace/routes.py index 9e2ee54e59..4d02c1f850 100644 --- a/autogpt_platform/backend/backend/api/features/workspace/routes.py +++ b/autogpt_platform/backend/backend/api/features/workspace/routes.py @@ -33,7 +33,7 @@ def _sanitize_filename_for_header(filename: str) -> str: return f'attachment; filename="{sanitized}"' except UnicodeEncodeError: # Use RFC5987 encoding for UTF-8 filenames - encoded = quote(filename, safe="") + encoded = quote(sanitized, safe="") return f"attachment; filename*=UTF-8''{encoded}"