Welcome Guest, Not a member yet? Register   Sign In
validating a required file upload field
#3

[eluser]stef25[/eluser]
hi pistolPete, that makes sense of course.

i setup my validation like this

Code:
if($this->form_validation->run('admin/index') == FALSE) {
    $this->load->view('admin_view', $attributes);
}

the i have in config/form_validation.php all the rules. for the image upload field i have

Code:
array(
     'field' => 'prod_img',
     'label' => 'product image',
     'rules' => 'callback__do_upload'
),

and a callback function:

Code:
function _do_upload($file) {
print $file; exit;
}

when the form is submitted i get a blank page, meaning the callback function gets called but the $file variable is empty. how can i pass the value from my validation file in the config folder back to my callback?

hope this makes sense ...

thanks


Messages In This Thread
validating a required file upload field - by El Forum - 04-07-2009, 08:00 AM
validating a required file upload field - by El Forum - 04-07-2009, 11:05 AM
validating a required file upload field - by El Forum - 04-07-2009, 12:51 PM
validating a required file upload field - by El Forum - 04-07-2009, 01:02 PM
validating a required file upload field - by El Forum - 04-07-2009, 05:13 PM



Theme © iAndrew 2016 - Forum software by © MyBB