LimeSurvey API - Master branch

UploadValidator
in package

Table of Contents

Properties

$files  : array<string, mixed>
$post  : array<string, mixed>

Methods

__construct()  : mixed
UploadValidator constructor.
getError()  : string|null
Check uploaded file size
redirectOnError()  : mixed
Check uploaded file size. Redirects to the specified URL on failure.
renderJsonOnError()  : mixed
Check uploaded file size. Renders JSON on failure.

Properties

$files

private array<string, mixed> $files

HTTP File Upload variables

Methods

__construct()

UploadValidator constructor.

public __construct([array<string|int, mixed>|null $post = null ][, array<string|int, mixed>|null $files = null ]) : mixed
Parameters
$post : array<string|int, mixed>|null = null

HTTP POST variables. If null, $_POST is used.

$files : array<string|int, mixed>|null = null

HTTP File Upload variables. If null, $_FILES is used.

getError()

Check uploaded file size

public getError(string $fileName[, mixed $customMaxSize = null ]) : string|null
Parameters
$fileName : string

the name of the posted file

$customMaxSize : mixed = null

maximum file upload size

Return values
string|null

the error message or null if all checks are ok

redirectOnError()

Check uploaded file size. Redirects to the specified URL on failure.

public redirectOnError(string $fileName, mixed $redirectUrl[, mixed $customMaxSize = null ]) : mixed
Parameters
$fileName : string

the name of the posted file

$redirectUrl : mixed

the URL to redirect on failure

$customMaxSize : mixed = null

maximum file upload size

renderJsonOnError()

Check uploaded file size. Renders JSON on failure.

public renderJsonOnError(string $fileName[, array<string|int, mixed> $debugInfo = [] ][, mixed $customMaxSize = null ]) : mixed
Parameters
$fileName : string

the name of the posted file

$debugInfo : array<string|int, mixed> = []

the URL to redirect on failure

$customMaxSize : mixed = null

maximum file upload size


        
On this page

Search results