我正在使用CodeIgniter上传文件(图片)。我想要修改错误消息,以便明确错误与哪个字段相关,因为页面上有多个上传选项。以下是我的上传代码:
$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'];
}
所以基本上我希望错误信息在错误消息中指出Logo Small,并且如果错误涉及到Logo Large等,我希望它指出这一点。