Codeigniter Multiple Files Upload Example

Codeigniter Multiple Files Upload Example

In this tutorial, we will tell you how to Upload Multiple files or multiple images with Codeigniter Framework. whenever we are uploading many images at that time we use the form_open_multipart.

first, we will take the form and some designing with bootstrap and we will also use multiple name attributes for the upload multiple images.

Codeigniter Multiple Files Upload Example, rename image in Codeigniter, multiple images upload, image upload, multiple files upload

Overview

Step 1:Create Upload Directory

Step 2:Create The Controller

Step 3:Create The Model

Step 4:Create The View

Step 1: Create Upload Directory

Now, we will create assets/uploads/ directory on own project directory.

Step 2: Create The Controller

After then, we will create the Multipleimage.php controller in the controller directory.

Here first, we will load the model and helper URL. when the user submits the form and uploads images that time we will check the condition and count how many images upload. we will be uploading images using the for loop. we rename all images using the PATHINFO_EXTENSION and pathinfo.

Step 3: Create The Model

Now, we will create the Image_model.php model in the model directory.

 

Step 4: Create The View

Finally, we will create the image.php file in the views directory. here in this file use below following code.

Please follow and like us: