Form_validation With File for CodeIgniter

Here you can find the info needed to add file validation to form_validation class of code igniter Please check the download section to get a copy of your code

Test Page

Testing Page

The validation on the page is the following:
<? $this->form_validation->set_rules($file_field_name,"YOUR FILE",
"file_required|file_min_size[10KB]|file_max_size[500KB]|file_allowed_type[image]|file_image_mindim[50,50]|file_image_maxdim[400,300]");

The max file upload size is set to 750K in php.ini . You can try to upload a bigger file to see how it reacts.

Downloads

Version 2.1
Version 2
Version 1