AfterDefaultUploadFolderWasResolvedEvent

New in version 12.3

The PSR-14 event \TYPO3\CMS\Core\Resource\Event\AfterDefaultUploadFolderWasResolvedEvent allows to modify the default upload folder after it has been resolved for the current page or user.

Example

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

EXT:my_extension/Configuration/Services.yaml
services:
  # Place here the default dependency injection configuration

  MyVendor\MyExtension\Resource\EventListener\MyEventListener:
    tags:
      - name: event.listener
        identifier: 'my-extension/after-default-upload-folder-was-resolved'
Copied!

Read how to configure dependency injection in extensions.

The corresponding event listener class:

EXT:my_extension/Classes/Resource/EventListener/MyEventListener.php
<?php

declare(strict_types=1);

namespace MyVendor\MyExtension\Resource\EventListener;

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

final class MyEventListener
{
    public function __invoke(AfterDefaultUploadFolderWasResolvedEvent $event): void
    {
        $event->setUploadFolder($event->getUploadFolder()->getStorage()->getFolder('/'));
    }
}
Copied!

API

class AfterDefaultUploadFolderWasResolvedEvent
Fully qualified name
\TYPO3\CMS\Core\Resource\Event\AfterDefaultUploadFolderWasResolvedEvent

Event that is fired after the default upload folder for a user was checked

getUploadFolder ( )
Returns
?\TYPO3\CMS\Core\Resource\FolderInterface
setUploadFolder ( \TYPO3\CMS\Core\Resource\FolderInterface $uploadFolder)
param $uploadFolder

the uploadFolder

getPid ( )
Returns
?int
getTable ( )
Returns
?string
getFieldName ( )
Returns
?string