Sane::validateFile()
Validates the contents of a file; the sane handlers are automatically chosen by the extension and MIME type if not specified
Sane::validateFile(string $file, string|bool $typeLazy = false): void
Parameters
Name | Type | Default | Description |
---|---|---|---|
$filerequired | string |
no default value | |
$typeLazy | string orbool |
false
|
Explicit handler type string,true for lazy autodetection orfalse for normal autodetection |
Exceptions
Type | Description |
---|---|
Kirby\Exception\InvalidArgumentException |
If the file didn't pass validation |
Kirby\Exception\NotFoundException |
If the handler was not found |
Kirby\Exception\Exception |
On other errors |