![]() |
File Upload Validation - 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 Upload Validation (/showthread.php?tid=74212) |
File Upload Validation - donpwinston - 08-27-2019 It appears that file upload validation is not working properly. I have the following: PHP Code: // $Id: Notice.php,v 1.3 2019/08/27 19:36:24 dwinston Exp $ Any pdf fails on mime type or extension validators. max size appears to work. RE: File Upload Validation - donpwinston - 08-28-2019 oof! 'notice' => 'mime_in[notice, application/pdf]|ext_in[notice, pdf]|max_size[notice, 2048]', should be 'notice' => 'mime_in[notice,application/pdf]|ext_in[notice,pdf]|max_size[notice,2048]', I had a space after the comma. RE: File Upload Validation - website - 08-28-2019 it's weird, this shouldn't be a error ![]() RE: File Upload Validation - includebeer - 08-28-2019 (08-28-2019, 06:16 AM)website Wrote: it's weird, this shouldn't be a error Maybe it could be improved, but it's the way it work. See: https://codeigniter4.github.io/CodeIgniter4/libraries/validation.html#available-rules Rule is a string; there must be no spaces between the parameters, especially the “is_unique” rule. There can be no spaces before and after “ignore_value”. “is_unique[supplier.name,uuid, $uuid]” is not ok “is_unique[supplier.name,uuid,$uuid ]” is not ok “is_unique[supplier.name,uuid,$uuid]” is ok RE: File Upload Validation - website - 08-28-2019 (08-28-2019, 08:13 AM)includebeer Wrote:(08-28-2019, 06:16 AM)website Wrote: it's weird, this shouldn't be a error you're right, but it's surprising anyway ![]() |