Здравствуйте, друзья! Я хочу загрузить два изображения в двух разных местах, но они все равно будут загружены в одно и то же место. Пожалуйста, помогите
//upload images
//some $config vars for image
$config['upload_path'] = './images/articles';
$config['allowed_types'] = 'gif|jpg|jpeg|png|mp3|wav';
$config['max_size'] = '0';
$config['remove_spaces'] = true;
$config['overwrite'] = false;
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
//upload main image
if(!$this->upload->do_upload('a_image')){
$e = $this->upload->display_errors();
//print_r($e);
}
$image = $this->upload->data();
if($image['file_name']){
$data['a_image'] = "images/articles/". $image['file_name'];
}
unset($config);
//now upload thumb
//some $config vars for thumb
$config['upload_path'] = './images/articles/thumb';
$config['allowed_types'] = 'gif|jpg|jpeg|png|mp3|wav';
$config['max_size'] = '0';
$config['remove_spaces'] = true;
$config['overwrite'] = false;
$config['max_width'] = '0';
$config['max_height'] = '0';
$this->load->library('upload', $config);
//upload thumbnail
if(!$this->upload->do_upload('a_thumbnail')){
$this->upload->dispaly_errors();
}