Feature: #83608 - PSR-14 event to modify resolved default upload folder

See forge#83608


A new PSR-14 event \TYPO3\CMS\Core\Resource\Event\AfterDefaultUploadFolderWasResolvedEvent has been added, which allows the default upload folder to be modified after it has been resolved for the current page or user.

The new event can be used as a better alternative to the $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauthgroup.php']['getDefaultUploadFolder'] hook, serving the same purpose.

The event features the following methods:

  • getUploadFolder() returns the currently resolved $uploadFolder
  • setUploadFolder() sets a new upload folder
  • getPid() returns the PID of the record we fetch the upload folder for
  • getTable() returns the table name of the record we fetch the upload folder for
  • getFieldName() returns the field name of the record we fetch the upload folder for

Registration of the event in your extension's Services.yaml:

    - name: event.listener
      identifier: 'my-extension/after-default-upload-folder-was-resolved-event-listener'

The corresponding event listener class:

namespace MyVendor\MyExtension\Resource\EventListener;

use TYPO3\CMS\Core\Resource\Event\AfterDefaultUploadFolderWasResolvedEvent;

final class MyEventListener
    public function __invoke(AfterDefaultUploadFolderWasResolvedEvent $event): void


As resolving the event was moved from BackendUserAuthentication to its own DefaultUploadFolderResolver class, this event is now the preferred way of modifying the default upload folder.