Daisuke Murase > FormValidator-Lite-0.15 > FormValidator::Lite::Constraint::File

Download:
FormValidator-Lite-0.15.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Source   Latest Release: FormValidator-Lite-0.37

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 $max, and second is $min. Second argument is optional.

syntax highlighting: