CodeIgniter Forums
Upload Not Working..? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: Upload Not Working..? (/thread-32821.html)



Upload Not Working..? - El Forum - 08-05-2010

[eluser]Corey Freeman[/eluser]
I dunno what's wrong with my controller, but it's just not uploading.

Code:
<?php
class Goals extends Controller {
    function Goals() {
    parent::Controller();
    }
    function index() {
        if(!$this->uri->segment(2)) {
        redirect('home');
        }
        $id = $this->uri->segment(2);
        $this->db->where('id', $id);
        $query = $this->db->get('goals');
        foreach($query->result() as $row):
        $title = $row->goal;
        $user_id = $row->user_id;
        $data['user_id'] = $row->user_id;
        endforeach;
        $this->db->where('id', $user_id);
        $data['user'] = $this->db->get('users');
        $data['title'] = $title;
        $this->db->where('id', $id);
        $data['query'] = $this->db->get('goals');
        $this->load->view('goals', $data);
    }
    function edit() {
        $config['upload_path'] = 'http://www.cloudreve.com/uploads/';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size'] = '100';
        $config['max_width'] = '1024';
        $config['max_height'] = '768';
        $this->load->library('upload', $config);
        $this->upload->do_upload();
        $this->load->model('goal_model');
        $this->goal_model->update_goal();
        redirect('goals/'.$this->uri->segment(3));
    }    
}



Upload Not Working..? - El Forum - 08-06-2010

[eluser]mi6crazyheart[/eluser]
I think u'r upload path probably should like this...
Code:
$config['upload_path'] = '/uploads/'; // if it is in root folder