I am doing the following to upload a file (image) using codeigniter. What I want to do is change the error message so that it is obvious which field is associated with the error, since there are several download options on the page, below is my download code,
$config['upload_path'] = './media/uploads/users';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '1000';
$config['max_width'] = '90';
$config['max_height'] = '60';
$this->upload->initialize($config);
if(!$this->upload->do_upload('logo_small'))
{
$error = array('error' => $this->upload->display_errors());
$this->template->build('users/employer', $error);
}
else
{
$file = $this->upload->data();
$logo_small = "small_".$file['file_name'];
}
So, I want the error message to be Small Small, and then, if the error is related to the logo of a large, etc., I would like it to indicate this.
source
share