• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing "userfile" to something else.

So im really new to CI, and im making a test project. So i want to make a small form where u enter some data and choose picture to upload.
Because of the problems with uploading, i only focused on setting form to upload things. I got it to work if i set name of file in form to "userfile", but i read in user guide that there is solution to change that name and use it as
,but i can't manage to do it. So any help?
Here's the code:
$config['upload_path'] = './uploads/';
  $config['allowed_types'] = 'gif|jpg|png';
  $config['max_size'] = '10000';
  $config['max_width']  = '1024';
  $config['max_height']  = '768';

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

  if ( ! $this->upload->do_upload($filename))
   $this->load->view('sma/header', $data);
                        $this->load->view('sma/upload_form', $data);
                        $this->load->view('sma/footer', $data);
   $data['error'] = 'Success!';

   $this->load->view('sma/header', $data);
                        $this->load->view('sma/upload_form', $data);
                        $this->load->view('sma/footer', $data);

can u please provide the full controller code........

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2021 MyBB Group.