Solar_Filter_ValidateUpload::validateUpload()

public bool Solar_Filter_ValidateUpload::validateUpload ( array $value , string|array $file_ext = NULL )

Validates that the value is an array of file-upload information, and if a file is referred to, that is actually an uploaded file.

Parameters

  • (array) $value: An array of file-upload information.

  • (string|array) $file_ext: An array of allowed filename extensions (without dots) for the file name. If empty, all extensions are allowed.

Returns

  • (bool) True if valid, false if not.

Description

Validates that the value is an array of file-upload information, and if a file is referred to, that is actually an uploaded file.

The required keys are 'error', 'name', 'size', 'tmp_name', 'type'. More or fewer or different keys than this will return a "malformed" error.



Local