---
title: "Feature: #105649 - New PSR-14 CustomFileSelectorsEvent"
manual: "TYPO3 Core Changelog"
version: "main"
permalink: "https://docs.typo3.org/permalink/changelog:feature-105649-1743710535"
source: "Changelog/14.2/Feature-105649-NewPSR-14CustomFileSelectorsEvent.rst"
typo3-version: "14.2"
typo3-major: 14
type: "feature"
issue: 105649
forge: "https://forge.typo3.org/issues/105649"
tags: ["Backend", "PHP-API", "ext:backend"]
rendered: "2026-10-01T16:39:42+00:00"
---

# Feature: #105649 - New PSR-14 CustomFileSelectorsEvent {#feature-105649-1743710535}

See [forge#105649](https://forge.typo3.org/issues/105649)

## Description {#description}

A new PSR-14 event `\TYPO3\CMS\Backend\Form\Event\CustomFileSelectorsEvent`
has been added. It is dispatched in
`\TYPO3\CMS\Backend\Form\Container\FilesControlContainer`
during the rendering of selectors for relations to `sys_file_references`.

To modify the selectors used to add files, the following methods are
available:

-   `getSelectors()`: Get all selectors
-   `setSelectors()`: Set all selectors
-   `getJavascriptModules()`: Get all JavaScript modules
-   `setJavascriptModules()`: Set all JavaScript modules
-   `getTableName()`: Get the table name of the current record
-   `getFieldName()`: Get the field name of the element
-   `getDatabaseRow()`: Get the raw database row
-   `getFieldConfig()`: Get the TCA configuration of the current field
-   `getFileExtensionFilter()`: Get the allowed and disallowed file
    extensions
-   `getFormFieldIdentifier()`: Get the DOM object ID used in the form

### Example {#example}

The corresponding event listener class:

```php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\EventListener;

use TYPO3\CMS\Backend\Form\Event\CustomFileSelectorsEvent;
use TYPO3\CMS\Core\Attribute\AsEventListener;

#[AsEventListener(identifier: 'my-extension/custom-file-selector')]
final class CustomFileSelectorEventListener
{
    public function __construct(
        private CustomDamFileSelector $damFileSelector,
    ) {}

    public function __invoke(CustomFileSelectorsEvent $event): void
    {
        $result = $this->damFileSelector->renderFileSelector(
            $event->getFormFieldIdentifier(),
        );
        $event->setSelectors(array_merge(
            $event->getSelectors(),
            $result['control'],
        ));
        $event->setJavascriptModules(array_merge(
            $event->getJavascriptModules(),
            $result['javaScriptModule'],
        ));
    }
}
```

## Impact {#impact}

It is now possible to modify file selectors using the new PSR-14 event
`\TYPO3\CMS\Backend\Form\Event\CustomFileSelectorsEvent`. This is
especially useful for integrating a DAM system.
