UploadValidator

package

Default

Methods

UploadValidator constructor.

__construct(\LimeSurvey\Models\Services\array<string,mixed>|null $post = null, $files = null)

Arguments

$post

\LimeSurvey\Models\Services\array|null

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

$files

Check uploaded file size

getError(string $fileName,mixed $customMaxSize = null): string|null

Arguments

$fileName

string

the name of the posted file

$customMaxSize

mixed

maximum file upload size

Response

string|null

the error message or null if all checks are ok

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

redirectOnError(string $fileName,mixed $redirectUrl,mixed $customMaxSize = null)

Arguments

$fileName

string

the name of the posted file

$redirectUrl

mixed

the URL to redirect on failure

$customMaxSize

mixed

maximum file upload size

Check uploaded file size. Renders JSON on failure.

renderJsonOnError(string $fileName,array $debugInfo = array(),mixed $customMaxSize = null)

Arguments

$fileName

string

the name of the posted file

$debugInfo

array

the URL to redirect on failure

$customMaxSize

mixed

maximum file upload size

Properties

HTTP POST variables

post :\LimeSurvey\Models\Services\array<string,mixed>
var

HTTP POST variables

Type(s)

\LimeSurvey\Models\Services\array

HTTP File Upload variables

files :\LimeSurvey\Models\Services\array<string,mixed>
var

HTTP File Upload variables

Type(s)

\LimeSurvey\Models\Services\array