bitrix24_im_post_file
Post any local file into a Bitrix24 chat — group, task, or direct. Images show inline previews; other file types appear as downloadable attachments with a short caption.
Instructions
Post local file(s) of ANY type into a Bitrix24 chat — .txt/.docx/.pdf/.zip/images alike — in a group/workgroup/project chat, a task chat, or a 1-on-1. This is the attachment counterpart to bitrix24_im_message_send (which is text-only) and the chat equivalent of bitrix24_task_attach_file / bitrix24_task_post_image (which only post into a TASK). IMAGES additionally render INLINE as a preview thumbnail; every other type posts as a normal downloadable file message with the caption — so use this whenever a file has to reach a chat, not just for pictures. Under the hood it uploads each file into the CHAT'S OWN disk folder and commits it (im.disk.folder.get → disk.folder.uploadfile → im.disk.file.commit) — the native-client flow, so every chat member can see it regardless of shared-folder permissions. One SEPARATE message is posted per file (Bitrix renders multiple images stacked in a single message with broken placeholders), and the same message caption is reused on each; for distinct captions call once per file. CAPTION RULE — the file-commit caption renders in an OVERSIZED font, so keep it to ONE short line and post any long explanation as a separate bitrix24_im_message_send message. Returns an array of the created message IDs. Same disclosure convention as bitrix24_im_message_send applies to any accompanying text message. ALWAYS prefer this over hand-rolling the upload with curl: it uses a proper multipart encoder, so filenames containing commas, spaces or Cyrillic are handled correctly, whereas curl -F 'file=@x;filename=a, b.txt' treats the comma as a multi-file separator and dies with «curl: (26) Failed to open/read local data» (caught 2026-07-24).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | No | Short one-line caption, reused on each file's message (see the caption rule). Optional — omit for no caption. | |
| dialogId | Yes | Target chat: 'chatNNN' for a group/task chat, or a numeric user ID for a 1-on-1 | |
| filePaths | Yes | Absolute local path(s) to the file(s) — any type. One message is posted per file. |