How to display uploaded image in CodeIgniter?
First of all, you need to save the image URL in the database. $this->model->insert_data($upoad_data[‘file_name’], $upoad_data[‘full_path’]); $data = array(‘upload_data’ => $this->upload->data()); $this->load->view(‘your_view’, $data);
Which method is used to upload file in CodeIgniter?
File uploading in CodeIgniter has two main parts. The frontend and the backend. The frontend is handled by the HTML form that uses the form input type file. On the backend, the file upload library processes the submitted input from the form and writes it to the upload directory.
How can upload file path in CodeIgniter?
- – Venkata Krishna. Oct 31 ’12 at 6:43.
- try $data[‘upload_data’][‘full_path’] from controller and $upload_data[‘full_path’] from view. – air4x. Oct 31 ’12 at 6:49.
- nope it’s giving error …………stating no index. – Venkata Krishna. Oct 31 ’12 at 6:49.
How do you upload a video to a database?
Store video file in a directory and insert file location in a MySQL database table. Display file using element. Before setting max file size for file size validation make sure to check post_max_size and upload_max_filesize in php. ini file and update it accordingly if required.
Does codeigniter rename file upload?
If set CodeIgniter will rename the uploaded file to this name. The extension provided in the file name must also be an allowed file type. If no extension is provided in the original file_name will be used. If set to true, if a file with the same name as the one you are uploading exists, it will be overwritten.
How can upload video in database in codeIgniter?
Create a project root directory called codeIgniter-upload-and-play-video. You need to create another directory under the project root directory, called upload that will contain the uploaded video file.