Documentation

onAfterAddFile

Event in called in the method \Bitrix\Disk\File::add after adding a file. When adding a new file, adds a new event version and then adds a new file event.

Event parameters

Parameter Description
$file Object type \Bitrix\Disk\File (created file)

Example

$eventManager = \Bitrix\Main\EventManager::getInstance();
$eventManager->addEventHandler('disk', 'onAfterAddFile', function (\Bitrix\Main\Event $event)
{
    list($file) = $event->getParameters();

    if($file instanceof \Bitrix\Disk\File)
    {
        var_dump("Filename {$file->getName()}");
    }
});


© «Bitrix24», 2001-2024
Up