DAM Setup (Digital Asset Management) for 1C-Bitrix
DAM is a centralized media file repository with metadata, tags, access rights, and versioning. In Bitrix, the role of DAM is fulfilled by the Media Library module (fileman), but in its default configuration it works as a simple file tree without structured metadata or content-based search.
Media Library Module Architecture
Files are stored in the b_file table — the central registry of all files in the system. Fields: ID, MODULE_ID, HEIGHT, WIDTH, FILE_SIZE, CONTENT_TYPE, SUBDIR, FILE_NAME, ORIGINAL_NAME, DESCRIPTION, HANDLER_ID.
The Media Library adds a folder structure on top of this via b_medialib_collection and a file-to-collection linkage via b_medialib_item. Each item (b_medialib_item) contains the fields KEYWORD (comma-separated tags) and DESCRIPTION.
For a full-featured DAM, the following are missing: hierarchical tags, links to catalog products, version history, and file-level permissions.
Metadata Extension
Custom properties for media files are added via user-defined types in b_uts_medialib_item. The table is created automatically when UF fields are added through the interface:
Settings → Users → User Fields → Object type: MEDIALIB_ITEM
Typical field set for DAM:
-
UF_COPYRIGHT— rights holder (string) -
UF_LICENSE— license type (list) -
UF_EXPIRY_DATE— rights expiry date (date) -
UF_USAGE_RIGHTS— areas of use (multiple list) -
UF_PHOTOGRAPHER— author (string)
Once added, the fields are available in the Media Library interface and via the API CMedialibItem::GetList().
Linking DAM to the Catalog
The main goal of DAM in an online store is to link media files to products so that a single image can be used in multiple places without duplicating the file. In Bitrix, this is solved via an infoblock property of the type "Link to Media Library elements".
A property is created in the catalog infoblock with the type E:MEDIALIB — this is a link to b_medialib_item.ID. When a file is updated in the Media Library, all products that use it automatically receive the updated version.
Searching the Media Library
Standard search on b_medialib_item only works by NAME and KEYWORD. To search by UF fields, a custom query is required:
$items = CMedialibItem::GetList([
'order' => ['ID' => 'DESC'],
'filter' => [
'KEYWORD' => 'product-photo',
'UF_LICENSE' => 'royalty-free',
],
'arSelectFields' => ['ID', 'NAME', 'FILE_ID', 'UF_COPYRIGHT'],
]);
For full-text search across metadata, the search module is connected — UF fields are indexed using CSearch::Index().
Uploading via API
Programmatic upload of a file to the Media Library with metadata:
CModule::IncludeModule('fileman');
$fileId = CFile::SaveFile([
'name' => 'product-main.jpg',
'type' => 'image/jpeg',
'tmp_name' => '/tmp/upload.jpg',
'MODULE_ID' => 'fileman',
], 'medialib');
$itemId = CMedialibItem::Add([
'COLLECTION_ID' => $collectionId,
'FILE_ID' => $fileId,
'NAME' => 'Product Photo',
'KEYWORD' => 'catalog, season-2024',
'FIELDS' => [
'UF_COPYRIGHT' => 'Acme Studio',
'UF_LICENSE' => 'royalty-free',
],
]);
What Is Included in the Setup
- Audit of the current Media Library structure and file storage
- Creating a collection hierarchy for the project's needs
- Adding UF fields for extended metadata
- Configuring the Media Library link to the catalog infoblock
- Implementing extended search by metadata
- Configuring collection access rights by user groups

