Image upload with Codeigniter

1) Create upload.php file inside controller, copy and past the following code into. Also create an ‘uploads’ folder inside the codeigniter root folder.

2) Create the upload_view and upload_success files inside view folder and insert the below codes into
upload_view

Upload Success

If you have any question regarding the codes above, you can ask as a comment. I will be here to answer your questions

  • Suryakant

    I believe you need to upload the file_path to the database field and then retrieve via the usual method. You do not upload images to databases in general.

  • joker555

    if upload folder path giving error
    then write —- $this->upload->initialize($config);
    before this—- $this->load->library(‘upload’,$config);

  • pirayt

    The upload path does not appear to be valid.