CodeIgniter Forums
File uploading and validation error! - 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: File uploading and validation error! (/showthread.php?tid=76977)



File uploading and validation error! - dimitrisgan97 - 07-09-2020

Hello,

Im trying to validate a file (image) along with other data and for some reason a i get the following exception when i dd() CodeIgniter\HTTP\RedirectResponse.

If i do not include the file validation everything is working fine..

Does anyone have any clue that may help?

Also any other idea (without need to change redirect())...?


Thanks!

Screenshots:

https://ibb.co/2vV7tdV
https://ibb.co/N12dfbP


Controller:

PHP Code:
$rules = [
  'email' => [
    'rules' => 'required|valid_email|max_length[255]|is_unique[users.email]',
    'label' => 'Email Address',
  ],
  ...
  ...
 
'face_photo' => 'max_size[face_photo,1024]' //If i delete this row everything is fine!
];

if (!
$this->validate($rules)) {
  //Something is happening with RedirectRespone.
  // Validator has set the error for the face_photo fine.
  //Also withInput() & with() are not working

  return redirect()->back()->withInput()->with('validation'$this->validator);