Welcome Guest, Not a member yet? Register   Sign In
Multiple Upload isnt working
#3

[eluser]flyenig[/eluser]
ok that didnt work and i tried this and it didnt work either:
Code:
function upload_pic()
    {
        $this->load->model('photo_model');
        $config['upload_path'] = './uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size']    = '1000000';
        $config['max_width']  = '10244';
        $config['max_height']  = '7688';
        //$config['file_name'] = $this->photo_model->newPhoto($stupdata['file_ext'])."_".$this->session->userdata('user_id');
        $this->load->library('upload', $config);
                    
        $arr = $_FILES['userfile']['tmp_name'];
            foreach($arr as $key)
            {
                if (!$this->upload->do_upload($key))
                {
                    echo $error = $this->upload->display_errors();
                    //$this->load->view('upload_form', $error);
                }    
                else
                {
                    //$photo_data = $this->upload->data('userfile');
                    //$dataP = array('photo_ext' => $photo_data['file_ext']);
                    //gather the data
                    $photodata = array('upload_data' => $this->upload->data());
                    //the original image file
                    $imgfile = $photodata['upload_data']['full_path'];
                    //Insert the photo_id into database
                    $this->photo_model->newPhoto($photodata['upload_data']['file_ext']);
                    //create the var to rename the photo
                    $new_name_img = $config['upload_path'].$this->db->insert_id()."_".$this->session->userdata('user_id').'.jpg';
                    //finally rename the photo
                    rename($photodata['upload_data']['full_path'],$new_name_img);
                    //create the thumbnail
                    $config['image_library'] = 'GD2';
                    $config['source_image'] = $new_name_img;
                    $config['create_thumb'] = TRUE;
                    $config['thumb_marker'] = '_th';
                    $config['maintain_ratio'] = TRUE;
                    $config['width'] = 130;
                    $config['height'] = 130;
                    $config['master_dim'] = 'width'; // this sets the resizer to default to height when preserving the ratio
                    $this->image_lib->clear();
                    $this->image_lib->initialize($config);
                    $this->image_lib->resize();
            
            /*if($this->input->post('upldbutton'))
            {
                $this->photo_model->create_thumbs($this->db->insert_id());
                $this->session->set_userdata(array('user_status' => 'uc'));
                //$this->db->update('users', array('user_status' => 'uc'));
                $userId = $this->session->userdata('user_id');
                $data = array(
                       'profile_img' => $this->db->insert_id()."_".$userId
                );
                $this->db->where('id',$userId);
                $this->db->update('users',$data);
                redirect('home');
            }
            else{
                redirect('photo/editPhoto/'.$this->db->insert_id().'/');
            }*/
                }
            
            
        }
    }


Messages In This Thread
Multiple Upload isnt working - by El Forum - 05-13-2010, 08:01 AM
Multiple Upload isnt working - by El Forum - 05-13-2010, 11:02 AM
Multiple Upload isnt working - by El Forum - 05-13-2010, 05:47 PM
Multiple Upload isnt working - by El Forum - 05-13-2010, 05:53 PM
Multiple Upload isnt working - by El Forum - 05-13-2010, 06:12 PM
Multiple Upload isnt working - by El Forum - 05-13-2010, 06:44 PM
Multiple Upload isnt working - by El Forum - 05-13-2010, 07:41 PM
Multiple Upload isnt working - by El Forum - 05-13-2010, 08:59 PM
Multiple Upload isnt working - by El Forum - 05-14-2010, 04:57 AM
Multiple Upload isnt working - by El Forum - 05-14-2010, 07:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB