%PDF- %GIF98; %PNG;
Server : ApacheSystem : Linux host.digitalbabaji.in 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64 User : addictionfreeind ( 1003) PHP Version : 7.2.34 Disable Function : exec,passthru,shell_exec,system Directory : /home/addictionfreeind/public_html/src/Model/Validation/ |
Upload File : |
<?php
namespace App\Model\Validation;
use Cake\Validation\Validator;
use Cake\ORM\Table;
use Cake\ORM\Rule\IsUnique;
class PictureValidator extends Validator {
public function __construct()
{
parent::__construct();
$this
->add('picture', [
'mimeType' => [
'rule' => array('mimeType', array('image/jpeg')),
'message' => 'jpg allowed',
'allowEmpty' => false,
],
'fileSize' => [
'rule' => array('fileSize', '<=', '1MB'),
'message' => '1MB.',
'allowEmpty' => false,
],
]);
}
}