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.

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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Most Popular Posts

What’s New in Docker 1.12

Posted on 1 year ago

Bhumi

How to use MySQL TimeStamp datatype

Posted on 6 years ago

Bhumi

How do I add items in Top navigation bar?

Posted on 4 years ago

Bhumi

How to save image in MySQL Database

Posted on 6 years ago

Bhumi