Welcome Guest, Not a member yet? Register   Sign In
Problem in uploading image
#6

[eluser]d1a8lo24[/eluser]
see the following example with your code

Code:
class Events_awards extends CI_Controller{
  public function _construct()
  {
    parents::_construct();
  }
  function index()
  {
        $config['upload_path']      =    './assets/images/news_events/';
        $config['allowed_types']    =    'gif|jpg|png';
        $config['max_size']         =    '0';
        $config['max_width']        =    '0';
        $config['max_height']       =    '0';
            
        $this->load->library('upload', $config);

        // since your file field name is called page_img just add the following line here.
        if ( ! $this->upload->do_upload('page_img'))
    {
            $error = array('error' => $this->upload->display_errors());

        $this->load->view('upload_form', $error);
    }
    else
        {

                redirect('events_awards/add_event');
        }
  }
}


Messages In This Thread
Problem in uploading image - by El Forum - 05-13-2011, 04:56 AM
Problem in uploading image - by El Forum - 05-13-2011, 08:29 AM
Problem in uploading image - by El Forum - 05-13-2011, 02:13 PM
Problem in uploading image - by El Forum - 05-13-2011, 02:15 PM
Problem in uploading image - by El Forum - 05-16-2011, 12:21 AM
Problem in uploading image - by El Forum - 05-16-2011, 12:40 AM
Problem in uploading image - by El Forum - 05-16-2011, 12:53 AM
Problem in uploading image - by El Forum - 05-16-2011, 12:54 AM



Theme © iAndrew 2016 - Forum software by © MyBB