[eluser]Conerck[/eluser]
[quote author="NachoF" date="1269213266"]I try to save anyway cause I want all the errors listed in the form.... the form has many input text fields and the userfile to upload... I want the form to list all of the errors and the upload error as well..... with your code I will only get the upload error and not the rest of the errors of the form in the case that it couldnt upload the file.[/quote]
You could try this
Code:
// This is mostly Phil's code
if ($this->upload->do_upload("url")) {
$data = $this->upload->data();
$a->url = $data['file_name'];
if($a->save($t)) {
$this->session->set_flashdata('success', 'Tip Creado');
redirect("Welcome");
}
} else {
// If the upload failed, this will validate the fields without saving the object
$a->validate();
// After validate has run you can append your custom errors
$a->error_message('custom', $this->upload->display_errors());
}