CodeIgniter Forums

Full Version: Upload Not Working..?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

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

class Goals extends Controller {
    function Goals() {
    function index() {
        if(!$this->uri->segment(2)) {
        $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;
        $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'] = '';
        $config['allowed_types'] = 'gif|jpg|png';
        $config['max_size'] = '100';
        $config['max_width'] = '1024';
        $config['max_height'] = '768';
        $this->load->library('upload', $config);

El Forum

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