Welcome Guest, Not a member yet? Register   Sign In
upload image problem at codeigniter
#1

[eluser]Pokhara[/eluser]
Hello frinds I want to upload two images at two different location but they still get ulpoaded at same place. Please help


Code:
//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();    
        }
#2

[eluser]Giorgio Nordo[/eluser]
What is the directory where the two images are loaded?
The first or the second one?




Theme © iAndrew 2016 - Forum software by © MyBB