\CodeIgniter\ValidationFileRules

File validation rules

Summary

Methods
Properties
Constants
__construct()
uploaded()
max_size()
is_image()
mime_in()
ext_in()
max_dims()
No public properties found
No constants found
No protected methods found
$request
N/A
No private methods found
No private properties found
N/A

Properties

Methods

uploaded()

uploaded(string  $blank = null, string  $name, array  $data) : boolean

Verifies that $name is the name of a valid uploaded file.

Parameters

string $blank
string $name
array $data

Returns

boolean

max_size()

max_size(string|null  $blank = null, string  $params, array  $data) : boolean

Verifies if the file's size in Kilobytes is no larger than the parameter.

Parameters

string|null $blank
string $params
array $data

Returns

boolean

is_image()

is_image(string|null  $blank = null, string  $params, array  $data) : boolean

Uses the mime config file to determine if a file is considered an "image", which for our purposes basically means that it's a raster image or svg.

Parameters

string|null $blank
string $params
array $data

Returns

boolean

mime_in()

mime_in(string|null  $blank = null, string  $params, array  $data) : boolean

Checks to see if an uploaded file's mime type matches one in the parameter.

Parameters

string|null $blank
string $params
array $data

Returns

boolean

ext_in()

ext_in(string|null  $blank = null, string  $params, array  $data) : boolean

Checks to see if an uploaded file's extension matches one in the parameter.

Parameters

string|null $blank
string $params
array $data

Returns

boolean

max_dims()

max_dims(string|null  $blank = null, string  $params, array  $data) : boolean

Checks an uploaded file to verify that the dimensions are within a specified allowable dimension.

Parameters

string|null $blank
string $params
array $data

Returns

boolean