In this video, I will show you how to upload any file or image in CodeIgniter using a function, function you can place anywhere controller or helper, or hook.
I recommend you to identify your reusable code or function which you can place in a common file, mostly we use a helper file and place all common functions in a helper file.
but in this video, I just show you how to upload any file with Codeigniter Library and validations.
Video from start: 00:30
Library URL - https://codeigniter.com/userguide3/li...
Steps:
Create a form for file upload.
Create a folder for file upload in your project directory.
then create a function for form submit in your controller
the define all the configurations for image upload
Inside the controller function, write a code for file validations
then for image upload, we will be using Codeigniter image upload library
use function do_upload of the image library
if the image is uploaded then return the image name
else return the error message for not uploading an image
Now you can store the file name in your database and use where ever you want
Happy Coding :)
Gourav Gupta
Hire Me - https://www.upwork.com/freelancers/~0...
Follow Me - / gouravguptaofficial
Subscribe to me - / @gouravguptaofficial
PHP Tutorial , Codeigniter , Codeigniter Tutorial in Hindi , Codeigniter Installation in Hindi , Codeigniter for Beginners , Codeigniter Step by Step Tutorial , Codeigniter 3 Tutorial , codigniter setup , Base URL in CodeIgniter , user agent , autoload
-------------------------------------------------------------------------------------------------------------
DISCLAIMER: This Channel Does Not Promote Any illegal content,
all contents provided by This Channel is meant for EDUCATIONAL purpose only.
Copyright Disclaimer Under Section 107 of the Copyright Act 1976, allowance is made for "fair use" for purposes such as criticism, comment, news reporting, teaching, scholarship, and research.
Fair use is a use permitted by copyright statutes that might otherwise be infringing.
Non-profit, educational, or personal use tips the balance in favor of fair use.