Welcome Guest, Not a member yet? Register   Sign In
uploading picture
#5

I wonder why this error still appears:

http://127.0.0.1/CompanyGiondaCI/index.p...ile/upload

404 Page Not Found
The page you requested was not found.


------------------------------------------------------------------

config/config.php


PHP Code:
$config['base_url'] = 'http://127.0.0.1/CompanyGiondaCI'



views/addslideshows.php

PHP Code:
<legend>CodeIgniter File Upload Demo</legend><br>
 
       <?php echo form_open_multipart('uploadfile/upload');?>
        
        <label><b>PHOTO GALLERY 1</b></label><br><br>
        
        <fieldset>
            <div class="form-group">
                <div class="row">
                    <div class="col-md-12">
                        <label for="filename" class="control-label">Select File to Upload</label> 
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="row">
                    <div class="col-md-12">
                        <input type="file" name="filename" size="20" />
                        <span class="text-danger"><?php if (isset($error)) { echo $error; } ?></span>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <div class="row">
                    <div class="col-md-12">
                        <input type="submit" value="Upload File" class="btn btn-primary"/>
                    </div>
                </div>
            </div>
        </fieldset> 



controllers/Cuploadfile.php

PHP Code:
<?php



class uploadfile extends CI_Controller {

 
   function __construct()
 
   {
 
       parent::__construct();
 
       $this->load->helper(array('form''url'));
 
   }

 
   //index function
 
   function index()
 
   {
 
       //load file upload form
 
       $this->load->view('addslideshows');
 
   }

 
   //file upload function
 
   function upload()
 
   {
 
       //set preferences
 
       $config['upload_path'] = 'uploads/';
 
       $config['allowed_types'] = 'jpg|gif';
 
       $config['max_size'   '500000';

 
       //load upload class library
 
       $this->load->library('upload'$config);

 
       if (!$this->upload->do_upload('filename'))
 
       {
 
           // case - failure
 
           $upload_error = array('error' => $this->upload->display_errors());
 
           $this->load->view('addslideshows'$upload_error);
 
       }
 
       else
        
{
 
           // case - success
 
           $upload_data $this->upload->data();
 
           $data['success_msg'] = '<div class="alert alert-success text-center">Your file <strong>' $upload_data['file_name'] . '</strong> was successfully uploaded!</div>';
 
           $this->load->view('addslideshows'$data);
 
       }
 
   }
}


?>
" If I looks more intelligence please increase my reputation."
Reply


Messages In This Thread
uploading picture - by davy_yg - 08-07-2016, 10:29 PM
RE: uploading picture - by davy_yg - 08-18-2016, 08:31 PM
RE: uploading picture - by wolfgang1983 - 08-22-2016, 07:23 PM
RE: uploading picture - by Fallebdi - 08-22-2016, 03:14 AM
RE: uploading picture - by davy_yg - 08-28-2016, 07:30 PM
RE: uploading picture - by ciadmin - 08-28-2016, 10:00 PM
RE: uploading picture - by davy_yg - 08-29-2016, 12:54 AM
RE: uploading picture - by salain - 08-29-2016, 02:50 AM
RE: uploading picture - by InsiteFX - 08-29-2016, 05:21 AM
RE: uploading picture - by davy_yg - 08-30-2016, 12:02 AM
RE: uploading picture - by wolfgang1983 - 08-30-2016, 12:30 AM
RE: uploading picture - by davy_yg - 08-30-2016, 12:38 AM
RE: uploading picture - by wolfgang1983 - 08-30-2016, 12:41 AM
RE: uploading picture - by davy_yg - 08-30-2016, 01:04 AM
RE: uploading picture - by salain - 08-30-2016, 01:09 AM
RE: uploading picture - by davy_yg - 08-30-2016, 01:45 AM
RE: uploading picture - by wolfgang1983 - 08-30-2016, 05:09 AM
RE: uploading picture - by salain - 08-30-2016, 02:09 AM
RE: uploading picture - by davy_yg - 09-12-2016, 11:01 PM



Theme © iAndrew 2016 - Forum software by © MyBB