validate image file only when uploaded |
Hi
I need to validate an image file only if it was uploaded by the user. I know I can use something like: PHP Code: if(isset($_FILE['image'])){ is there any internal validation rule to achieve this? premit_empty() ignore the whole validation
Hi, we do have an file uploads rules, if that's what you are after?
https://codeigniter.com/user_guide/libra...le-uploads Or you can write your own: https://codeigniter.com/user_guide/libra...stom-rules
$image = $this->request->getFile('input_fiee_name');
if($image->isValid) { //Your code here } |
Welcome Guest, Not a member yet? Register Sign In |