diff --git a/homeassistant/components/telegram_bot/__init__.py b/homeassistant/components/telegram_bot/__init__.py index df5bebb47d4..06c15da5f70 100644 --- a/homeassistant/components/telegram_bot/__init__.py +++ b/homeassistant/components/telegram_bot/__init__.py @@ -287,7 +287,9 @@ SERVICE_MAP = { def _read_file_as_bytesio(file_path: str) -> io.BytesIO: """Read a file and return it as a BytesIO object.""" with open(file_path, "rb") as file: - return io.BytesIO(file.read()) + data = io.BytesIO(file.read()) + data.name = file_path + return data async def load_data(