CodeIgniter v4.5 API

FileRules
in package

File validation rules

Tags
see
FileRulesTest

Table of Contents

Properties

$request  : IncomingRequest
Request instance. So we can get access to the files.

Methods

__construct()  : mixed
Constructor.
ext_in()  : bool
Checks to see if an uploaded file's extension matches one in the parameter.
is_image()  : bool
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.
max_dims()  : bool
Checks an uploaded file to verify that the dimensions are within a specified allowable dimension.
max_size()  : bool
Verifies if the file's size in Kilobytes is no larger than the parameter.
mime_in()  : bool
Checks to see if an uploaded file's mime type matches one in the parameter.
uploaded()  : bool
Verifies that $name is the name of a valid uploaded file.

Properties

Methods

ext_in()

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

public ext_in(string|null $blank, string $params) : bool
Parameters
$blank : string|null
$params : string
Return values
bool

is_image()

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.

public is_image(string|null $blank, string $params) : bool
Parameters
$blank : string|null
$params : string
Return values
bool

max_dims()

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

public max_dims(string|null $blank, string $params) : bool
Parameters
$blank : string|null
$params : string
Return values
bool

max_size()

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

public max_size(string|null $blank, string $params) : bool
Parameters
$blank : string|null
$params : string
Return values
bool

mime_in()

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

public mime_in(string|null $blank, string $params) : bool
Parameters
$blank : string|null
$params : string
Return values
bool

uploaded()

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

public uploaded(string|null $blank, string $name) : bool
Parameters
$blank : string|null
$name : string
Return values
bool

        
On this page

Search results