Skip to content

Kirby 5.6.3

$api->upload()

Upload helper method

$api->upload(Closure $callback, bool $single = false, bool $debug = false, string|null $template = null, Closure|null $preflight = null): array

Parameters

Name Type Default
$callbackrequired Closure no default value
$single bool false
$debug bool false
$template stringornull null
$preflight Closureornull null

Return type

array

This method modifies the existing $api object it is applied to and returns it again.

Exceptions

Type Description
Exception If request has no files or there was an error with the upload

Parent class

Kirby\Api\Api