• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
File upload file_name not returning any values

#1
PHP Code:
$this->load->helper(array('form''url'));
  
  
$config['upload_path'] = 'uploads/file/';
  
$config['allowed_types'] = 'xlsx|pdf|txt';
  
$config['max_size'] = '5000';
  
$this->load->library('upload');
  
$this->upload->initialize($config);
$file $this->upload->data();
$file_name $file['file_name']; 

Everything is working fine and my uploaded file can move to it's path but i want to know why this code is not working.It is also indicated in the user guide. Even the all of the data from the uploaded file returns no value(like raw_name, file_ext). I searched all over the web and i can't find any answers to my problem.
I'm using Wampserver 2.5. Php 5.5.12.
Reply

#2
The code you've provided is missing a call to $this->upload->do_upload('fieldname')
Reply

#3
Thanks! finally it worked! +1
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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