FileRules::create()
Validates if the file can be created
FileRules::create(Kirby\Cms\File $file, Kirby\Filesystem\File $upload): void
Parameters
Name | Type | Default |
---|---|---|
$filerequired | Kirby\Cms\File |
no default value |
$uploadrequired | Kirby\Filesystem\File |
no default value |
Exceptions
Type | Description |
---|---|
Kirby\Exception\DuplicateException |
If a file with the same name exists |
Kirby\Exception\PermissionException |
If the user is not allowed to create the file |