AfterFileCommandProcessedEvent

New in version 11.4.

The AfterFileCommandProcessedEvent can be used to perform additional tasks for specific file commands. For example, trigger a custom indexer after a file has been uploaded.

The AfterFileCommandProcessedEvent is fired in the ExtendedFileUtility class.

Registration of the event in the Services.yaml:

MyVendor\MyPackage\File\MyEventListener:
  tags:
    - name: event.listener
      identifier: 'my-package/file/my-event-listener'

The corresponding event listener class:

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

class MyEventListener {

    public function __invoke(AfterFileCommandProcessedEvent $event): void
    {
        // do magic here
    }

}

API

getCommand()

| ReturnType: array |

Returns the command array. The array key is the performed action and the value is the command data (cmdArr).

getResult()

| ReturnType: mixed |

Returns the operation result, which could e.g. be an uploaded or changed File or a boolean for the “delete” action

getConflictMode()

| ReturnType: string |

The conflict mode for the performed operation, e.g. “rename” or “cancel”.