mcpField
B
bitrix-files

bitrix-files

github.com/bxmaximumDevelopment4780 installsUpdated 2w ago
Repository

About bitrix-files

A Bitrix file-handling skill for developers working with storage, uploads, delivery, and UI uploader workflows. It outlines safe practices for file IDs, validation, private-file access, and deletion.

Key features

  1. 01Manage file storage through CFile
  2. 02Validate uploaded files
  3. 03Handle pending UI uploader files
  4. 04Serve private files with access checks

Use cases

  1. 01Save or replace files while retaining IDs
  2. 02Validate uploads in an application action
  3. 03Deliver private files only after rights checks

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/bxmaximum/bitrix-framework-skills --skill bitrix-files

After installing, type/bitrix-filesin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

rules/
delivery.md
storage.md
ui-uploader.md
uploads.md

Details

From the project README

Bitrix files

Baseline: main 23.0+ · Verified: main 26.800.0, ui 26.687.0

TaskRead
Save, read, resize, delete; b_file layout; clouds; replace content keeping the IDrules/storage.md
Accept uploads in your action: validation, MIME, legacy main.file.inputrules/uploads.md
ui.uploader backend: UploaderController, commit pending filesrules/ui-uploader.md
Serve files: BFile, private files, viewerrules/delivery.md

JS widgets (ui.uploader, ui.viewer): bitrix-ui. Uploader settings in .settings.php: bitrix-settings. File fields: bitrix-iblocks, bitrix-highloadblock.

Invariants

  • Write b_file only through CFile. FileTable is read-only: add/update/delete throw NotImplementedException. Store the file ID, never a path.
  • For URLs use CFile::GetFileArray()['SRC'] or CFile::GetPath(); for local bytes use CFile::MakeFileArray($id)['tmp_name']. Never glue /upload/ + SUBDIR yourself: clouds, the upload_dir option and replacements all break it.
  • Client name, MIME and size are untrusted: whitelist extensions, detect MIME from content, and decode images.
  • Never pass user input to CFile::MakeFileArray(): it reads local paths, b_file IDs and URLs.
  • Everything in /upload/ is reachable by URL. Serve private files through an action that checks rights.
  • CFile::Delete() removes the physical file and its resize cache. It cannot be undone.

Comments

Markdown supported