AfterFileCommandProcessedEvent

New in version 11.4

The PSR-14 event \TYPO3\CMS\Core\Resource\Event\AfterFileCommandProcessedEvent can be used to perform additional tasks for specific file commands. For example, trigger a custom indexer after a file has been uploaded.

This event is fired in the \TYPO3\CMS\Core\Utility\File\ExtendedFileUtility class.

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-file-command-processed'
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\AfterFileCommandProcessedEvent;

final class MyEventListener
{
    public function __invoke(AfterFileCommandProcessedEvent $event): void
    {
        // Do magic here
    }
}
Copied!

API

class \TYPO3\CMS\Core\Resource\Event\ AfterFileCommandProcessedEvent

Event that is triggered after a file command has been processed. Can be used to perform additional tasks for specific commands. For example, trigger a custom indexer after a file has been uploaded.

getCommand ( )

A single command, e.g.

'upload' => [
    'target' => '1:/some/folder/'
    'data' => '1'
]
Copied!
returntype

array

Returns:

array<string,array<string,mixed>>

getResult ( )
returntype

mixed

Returns:

mixed The result - Depending on the performed action,

getConflictMode ( )
returntype

string

Returns:

string The current conflict mode