How to upload files in Codeigniter using Bootstrap

Dear Reader, let us know that, “How to upload files in Codeigniter using Bootstrap with Live Demo“. So in this Tutorial, We Learn Step By Step  Files Uploading Process in Codeigniter using Bootstrap.

This post is about CodeIgniter(C.I.) file upload. By the use of file uploading class, you can easily upload a file or an image.

One can easily validate and restrict file type, its size and can even provide various preferences while uploading a file or image.

First, we see Snapshot for File Uploading Form


And you can also see Live Demo by click on bellow Demo button

Step 1:- First of all we need to create the database like ci_demo

Step 2:- Now create a table “files” in a database using the below SQL code

Step 3:- Now we need to configure config.php  in bellow URL “ci_demo\application\config/autoload.php” 

Step 4:- Now we need to create “uploads” folder in root directory like “ci_demo\uploads” 

Step 5:- Now we create “uploads” folder in Application’sController” and create “Uploads.php” Controller like directory like “ci_demo\application\controllers\uploads\Uploads.php”  paste below code


Step 6:- Now we create “uploads” folder in Application’s “Models” Folder  and create “Upload.php” Model like directory like “ci_demo\application\models\uploads\Upload.php”  paste bellow code

Step 7:- Now we create “uploads” folder in Application’sviews” Folder  and create “uploads.php” View file like directory like “ci_demo\application\views\uploads\uploads.php”  paste bellow code

Step 8:- Now we create “uploads” folder in Application’sviews” Folder  and create “uploads_success.php” View file directory like “ci_demo\application\views\uploads\uploads_success.php”  paste bellow code

Step 9:-  In uploads.php and uploads_success.php (view) files we add some CSS and JS, so download assets folder here 

extract zip file and copy assets folder and paste in your project’s root directory as we can see in bellow snapshot



Step 10:-  Now for run your project open browser and type in URL like localhost/your_project_name/uploads/uploads



you can see the result as we can see in below snapshot


Congratulations you have successfully Completed Files Uploading Process  in Codeigniter  using Bootstrap if this post was helpful for you then please share this post on social media and if you have any query then please contact us or comment below and don’t forget us follow and like on Social Media, Thanks



  • adidas stan smith April 25, 2018

    I precisely desired to thank you so much all over again. I do not know the things that I would’ve achieved without the creative concepts contributed by you on this subject matter. It absolutely was a very traumatic situation in my circumstances, nevertheless encountering the expert form you resolved that took me to weep over fulfillment. I am thankful for your information and then pray you find out what a great job that you are undertaking training the rest via your websites. Probably you haven’t got to know all of us.


    • Webpreparations Team April 25, 2018

      Thanks 🙂


Leave a comment:

Your email address will not be published. Required fields are marked *