Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

codeigniter file upload

I am doing the following to upload a file(image) using codeigniter. What I am wanting to do is modify the error message so that it obvious which field the error relates too as there are multiple upload options on the page, below is my upload 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 basically I want there error message to state Logo Small in the error message, and then if the error relates to Logo large etc I would want it to state that.

like image 513
Udders Avatar asked Apr 03 '26 01:04

Udders


1 Answers

easiest way is to edit system/language/english/upload_lang.php with the error message you want. enter image description here

like image 197
Vamsi Krishna B Avatar answered Apr 04 '26 14:04

Vamsi Krishna B