Codeigniter has a number of libraries and helpers which you can use for making your code reliable and bugs free. CI provides an extensive library of common usage classes. Upload class in Codeigniter provides us a simple and easy way for uploading files on server.
2 thoughts on “How to Upload files in Codeigniter. A simple way for beginner of CI”
Comments are closed.
Thank you for your post i want to know how to insert a image name
/*— Controller —*/
$data = array(‘upload_data’ => $this->upload->data());
$this->load->view(‘your-upload-page’, $data);
/*— View –*/
echo $upload_data[‘file_name’]; //this will output the image name
echo $upload_data[‘image_size_str’]; //this will output the width and the height of the image
<img src="” />