file_validate

function file_validate

file_validate(FileInterface $file, $validators = array())

Checks that a file meets the criteria specified by the validators.

After executing the validator callbacks specified hook_file_validate() will also be called to allow other modules to report errors about the file.

Parameters

\Drupal\file\FileInterface $file: A file entity.

array $validators: (optional) An associative array of callback functions used to validate the file. T