Skip to content

File extension can be changed when renaming paste-generated message.txt attachment #31202

Description

@jebenna

Steps to reproduce

  1. Open Telegram Desktop.
  2. Open any chat.
  3. Paste a sufficiently large block of plain text into the message field so that Telegram offers to send it as a file.
  4. Select the option to send the pasted content as a file. Telegram creates an attachment named "message.txt".
  5. In the file preview, choose "Rename".
  6. Change the filename extension from ".txt" to another extension, for example ".sh".
  7. Confirm the rename.
  8. Compare this behavior with renaming a normal file attached from the filesystem: in the normal file attachment flow, the extension cannot be changed independently.

Expected behaviour

The filename extension should be handled consistently with normal file attachments. When renaming the generated "Message.txt" attachment, the ".txt" extension should either remain protected or the same extension-editing rules should be applied consistently across file attachment flows.

Actual behaviour

When renaming the file generated from pasted text, Telegram allows the ".txt" extension to be edited or completely replaced. For example, "Message.txt" can be renamed to "Message.sh".

In contrast, when renaming a normal file attached from the filesystem, Telegram allows the base filename to be changed but does not allow the extension to be changed.

Operating system

Ubuntu 24.04.4 LTS

Version of Telegram Desktop

7.1.3

Installation source

Downloaded from desktop.telegram.org or GitHub

Crash ID

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions