++ed by:
NUKOSUKE TOMITA

2 PAUSE users
2 non-PAUSE users.

MATSUNO★…Tokuhiro
and 18 contributors

NAME

FormValidator::Lite::Constraint::File - file constraints

DESCRIPTION

This module provides validation rule for uploaded files.

RULES

FILE_MIME
    $valiator->check(
        'file' => [['FILE_MIME', 'text/plain']],
    );

Check the file content-type.

FILE_SIZE
    $valiator->check(
        'file' => [['FILE_SIZE', 1_000_000, 100]],
    );

Check the file size. First argument is the upper limit in bytes, and second is lower limit in bytes. Second argument is optional.