Skip to content

Kirby 3.8.4

FileRules::replace()

Validates if the file can be replaced

FileRules::replace(Kirby\Cms\File $file, Kirby\Filesystem\File $upload): bool

Parameters

Name Type Default
$file * Kirby\Cms\File
$upload * Kirby\Filesystem\File

Return type

bool

Exceptions

Type Description
Kirby\Exception\PermissionException If the user is not allowed to replace the file
Kirby\Exception\InvalidArgumentException If the file type of the new file is different

Parent class

Kirby\Cms\FileRules