bitrix24_task_attach_file
Attach local files (docx, pdf, images) to Bitrix24 tasks as downloadable attachments, preserving existing files. Use for briefs, reports, or specs that need to appear in the task's Files tab.
Instructions
Attach a local file (docx, pdf, image, anything) to a Bitrix24 task. Use this for delivering briefs, reports, signed-off specs — anything that should land as a downloadable attachment in the task's Files tab. The file shows as « добавил файл» in chat but WITHOUT an image thumbnail/preview even for PNG/JPG (chat just shows filename). For screenshots / images you want INLINE-PREVIEWED in chat, use bitrix24_task_post_image instead — that posts a proper chat message with IMAGE attachment blocks that render as thumbnails. Stays linked to UF_TASK_WEBDAV_FILES. SAFE: existing attachments are preserved (read-merge-write); your file is appended, not replaced. Two-step under the hood: disk.folder.uploadfile → multipart POST → tasks.task.update with the merged UF_TASK_WEBDAV_FILES list (each id encoded as 'n').
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| taskId | Yes | Task ID | |
| fileName | No | Override the file name visible in B24. Defaults to basename(filePath). | |
| filePath | Yes | Absolute local path to the file to upload (e.g. /tmp/brief.docx) | |
| folderId | No | Disk folder ID to upload to. Default 732896 (shared 'Блог' folder, verified writable for user 854). Override only if you need the file in a specific workgroup folder. |