form validation - show upload errors |
I'd like some help please.
I', having a contact form in which I can also upload files. I have set up the form validation and the uploading configuration according to the documentation, however I have spotted a "logic" problem. If I submit all the form fields with valid data and select an invalid type file to upload, the form process works as correct, and redirects to my "thank you" page, whereas I should get the error message from the invalid file upload. I 'm assuming this is because the upload errors are not part of the form_validation library or the two libraries don't "communicate" some way. How can I fix this bug ? This is my code PHP Code: protected $rules = array(
If you want your validation of the file upload to be part of the form validation, you should create a validation rule to perform the file upload/validation. In other words, you could do something like this:
PHP Code: protected function where_you_run_the_validation() |
Welcome Guest, Not a member yet? Register Sign In |