// If the filename has been modified, let the user know.
if($event->isSecurityRename()){ $result->setSecurityRename(); }
// Set the permissions on the new file.
$this->fileSystem->chmod($file->getFileUri());
// We can now validate the file object itself before it's saved.
$violations = $file->validate(); foreach($violationsas$violation){ $errors[] = $violation->getMessage(); } if(!empty($errors)){