Upload Image using CodeIgniter with MySQL

File upload functionality is one of the most common requirements for most of the web applications. Codeigniter file upload library is very simple to use. CodeIgniter’s File Uploading Class permits files to be uploaded. You can set various preferences, restricting the type and size of the files. Follow the steps shown in the given example to understand the file uploading process in CodeIgniter.
Step 1: Create MySQL Database and Table
Step 2: Create a model file
Create a model file named “Upload_model.php” inside “application/models” folder.
Step 3: Update constants file
Add code the file application/config/constants.php in your CodeIgniter installation with you controller’s name.
Step 4: Create a controller file
Next create a controller file named “Image.php” inside “application/controllers” folder.
Step 5: Create a view
Create a view file named “index.php” inside “application/views/img” folder