problems validation image - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: problems validation image (/showthread.php?tid=79310) |
problems validation image - bengtdg - 05-26-2021 Having trouble with validation of an image upload... When "kategori" fails validation, it returns the error message... but when the image upload fail, i get no error message. so this is the validator in the controller... PHP Code: ## Validation And this is the form view PHP Code: <?php $validation = \Config\Services::validation(); ?> I recon i got some error in my codingm, but i can't find it. Any help is appreciated. Rgrds Bengt RE: problems validation image - InsiteFX - 05-26-2021 Read this. CodeIgniter 4 User Guide - Working with Uploaded Files RE: problems validation image - bengtdg - 05-26-2021 (05-26-2021, 09:13 PM)InsiteFX Wrote: Read this. Thank you. I have read there. It failes here when validation of image fails... PHP Code: if(isset($postData['submit'])){ som var dump from the var dumps above Code: $request = service('request'); It just pussles me. If validation of kategori fails, it returns the error message . But nothing happens when validation of image fails. The validation error never comes back to the form. If i set max_file to 4096 then the file is successfully uploaded. RE: problems validation image - InsiteFX - 05-27-2021 Take a look at the Myth/Auth AuthController and layout views. Also look at the _message_block view. Will show you how Lonnie does it using sessions etc; Also file sizes are set in the php.ini file. max_post_size and max_file_size they should both be set to the same value. RE: problems validation image - paliz - 05-27-2021 PHP Code: $rules = [ |