problems validation image |
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
Read this.
CodeIgniter 4 User Guide - Working with Uploaded Files What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
(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.
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. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
PHP Code: $rules = [
Enlightenment Is Freedom
|
Welcome Guest, Not a member yet? Register Sign In |