-->



Wednesday, October 14, 2015

Codeigniter--Image-upload

After Encrption and Decryption of data, we will be learning about Image uploading.

1.  Rename your Codeigniter folder as "UploadIgniter".

2.  Now configure your files.Go to C:\xampp\htdocs\UploadIgniter\application\config. 
     Now select  autoload.php and make changes as follows.

                  $autoload['libraries'] = array('xmlrpc');
                  $autoload['helper'] = array('url', 'file','form');  

3.  Select config.php and make the changes as follows.

                   $config['base_url'] = 'http://localhost/UploadIgniter/';

4.   Select routes.php and make the changes as follows.

                    $route['default_controller'] = "upload_controller";
                    $route['404_override'] = '';

5.  Create a new folder named "css" in C:\xampp\htdocs\UploadIgniter.

6.  Create a new folder named "uploads" in C:\xampp\htdocs\UploadIgniter.

7.  Now create a new file upload_controller.php in                                                                                C:\xampp\htdocs\UploadIgniter\application\controllers. Copy and paste the code given below.


                                        upload_controller.php

      

8.  Now create a new file upload_view.php in                                                                                        C:\xampp\htdocs\UploadIgniter\application\views. Copy and paste the code given below.

                                           upload_view.php




9.  Now create a new file upload_success.php in                                                                                    C:\xampp\htdocs\UploadIgniter\application\views. Copy and paste the code given below.

                                           upload_success.php



10. Now create a new file style.css in C:\xampp\htdocs\UploadIgniter\css. Copy and paste the code given below.

                                              style.css




10. Finally redirect the url to http://localhost/UploadIgniter/. You should get a screen like this.

                     

11. That's it!!, We have successfully created the Image-uploading form.In the next tutorial, we will be learning about Cross-site Scripting.

No comments:

Post a Comment