Back to Top

How to upload image in CodeIgniter?

Image Uplod in CodeIgniter

CodeIgniter makes it easy to add images to your site. You can upload them using code I am going to explain here in this post that How to upload image in CodeIgniter?.If you want to upload an image in CodeIgniter, you need to write following HTML code into your view file which will create the field to upload an image.

Now in the form action, at the PHP side, your code should be this. Here txtImage is your input field name. You have to provide upload_path, allowed types, max_size etc. You can ecrypt the file name by passing encrypt_name = true. The else part creates image thumbnail for specified height and width.

That’s it, Your image is get uploaded to the folder.you can have a look into the folder. 🙂

Thank you for reading, good luck and let me know if you run into any problems & I’ll help as much as I can 🙂

Hope this post will helpful for you, waiting for your responses.Thanks for reading and feel free to share your thoughts! Don’t Forget to Follow us on Twitter or Subscribe us to Get the Latest Updates.

Share:
Share on Facebook0

Share on LinkedIn0Tweet about this on TwitterShare on Google+0Buffer this pageDigg thisShare on Reddit0

Comments (4)

  1. Thanks For Your Tutorial. I Have Success In My Coding to Upload Image File. Yeah. Thanks….

  2. akhtar ansari says:

    very nice

  3. i upload my file in remote server …but my file not upload in remote side…but the file store in local host … what is the problem…plz give me the solution sir….

  4. nice dude your the man . thanks a lot .

Leave a Reply

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

Most Popular Posts

Warning: Ignoring WordPress Can Be a Blunder

Posted on 4 years ago

Nick Carter

How to Detect the Orientation of Ipad

Posted on 5 years ago

Bhumi

How to Use Improved MySQLi in PHP

Posted on 5 years ago

Bhumi

How to Use HTML5 Data Attributes

Posted on 1 year ago

Bhumi

How to display XML content with PHP

Posted on 4 years ago

Bhumi

Introduction to the Instagram API

Updated 4 weeks ago

Bhumi

How to Use the HTML5 Full-Screen API

Updated 1 month ago

Bhumi

What are Lambdas and Closures in PHP?

Updated 1 month ago

Bhumi

MySQL REGEXP Operator

Updated 1 month ago

Bhumi

The Reader’s Poll – August 2014

Posted on 2 years ago

Bhumi

The Reader’s Poll – June 2014

Posted on 3 years ago

Bhumi

The Readers’ Poll – May 2014

Posted on 3 years ago

Bhumi