CodeIgniter Forums
File upload file_name not returning any values - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: File upload file_name not returning any values (/showthread.php?tid=63373)



File upload file_name not returning any values - shezmaru2 - 10-23-2015

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.


RE: File upload file_name not returning any values - mwhitney - 10-26-2015

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


RE: File upload file_name not returning any values - amhrie27 - 10-30-2015

Thanks! finally it worked! +1