Welcome Guest, Not a member yet? Register   Sign In
!$this->upload->do_upload() - first time around
#4

[eluser]flaky[/eluser]
put the code here, so I can help you

based on what you wrote
Quote:Now when i place this in a controller and then load the sample view provided - enter the URL into the browser - i am immediately told that no file has been uploaded… correct, as i have not even submitted the form yet!
I come to the conclusion that this code is inside the contructor or index, like this
Code:
//it is in the construct
    public function __construct(){
        //it is here
        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());        
            $this->load->view('upload_form', $error);
        }    
        else
        {
            $data = array('upload_data' => $this->upload->data());
            $this->load->view('upload_success', $data);
        }
    }

    //or it is in the index
    public function index(){
        if ( ! $this->upload->do_upload())
        {
            $error = array('error' => $this->upload->display_errors());        
            $this->load->view('upload_form', $error);
        }    
        else
        {
            $data = array('upload_data' => $this->upload->data());
            $this->load->view('upload_success', $data);
        }
    }

cheers


Messages In This Thread
!$this->upload->do_upload() - first time around - by El Forum - 04-07-2010, 11:50 AM
!$this->upload->do_upload() - first time around - by El Forum - 04-07-2010, 02:34 PM
!$this->upload->do_upload() - first time around - by El Forum - 04-07-2010, 04:11 PM
!$this->upload->do_upload() - first time around - by El Forum - 04-08-2010, 12:13 AM
!$this->upload->do_upload() - first time around - by El Forum - 04-08-2010, 01:19 AM
!$this->upload->do_upload() - first time around - by El Forum - 04-08-2010, 02:55 AM



Theme © iAndrew 2016 - Forum software by © MyBB