FormValidator::Lite::Constraint::File - file constraints
This module provides validation rule for uploaded files.
$valiator->check( 'file' => [['FILE_MIME', 'text/plain']], );
Check the file content-type.
$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.
To install FormValidator::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm FormValidator::Lite
CPAN shell
perl -MCPAN -e shell install FormValidator::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.