CodeIgniter上传图像/ pdf表单验证

I have two image upload/pdf fields which are validated with a callback function as follow:

$this->form_validation->set_rules('image', 'Upload Image', 'callback_upload_image');
$this->form_validation->set_rules('cv', 'Upload CV', 'callback_upload_cv');

I have two separate function upload_image and upload_cv but when I submit the form, it always calls the first (image_upload) function. So, the second callback function is not working.

Any ideas please?

Finally I could solve the problem. I have restrict my form validation call as:

if($_FILES['source']['name'] != ''){
    $this->form_validation->set_rules('source', 'Upload Image',  'callback_upload_image');
}
if($_FILES['cv']['name'] != ''){
    $this->form_validation->set_rules('cv', 'Upload CV', 'callback_upload_cv');  
}

and in upload_cv function instead of load upload library I used: $this->upload->initialize($config); //to reinitialize the config variable values. Now, everything is working fine.