• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
No way to permit empty on file upload

$Rules['image'] = ['label' => 'Image', 'rules'=>'uploaded[image]|is_image[image]|max_size[image.2048]'];

I am always getting an error for the image that is not an uploaded image file.

But i am not uploading any.

How can i make this rule permit empty. And only if something was set should validate the rules...

I tried with permit_empty, it does not work.
It doesn't show any validation errors if i upload a wrong image or exceed max file size or even if i upload another type of file that is not an image...

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.