i need to store only filename + extension of file when upload and rename done to my databse.my problem is can't get extension.
$new_file_name=date("mdY")."_".time();
$config['upload_path'] = './assets/images/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = 2048;
$config['max_width'] = 1024;
$config['max_height'] = 768;
$config['file_name'] = $new_file_name;
$this->load->library('upload', $config);
if ( ! $this->upload->do_upload('uploadFile'))
{
$error = array('error' => $this->upload->display_errors());
var_dump($error);
}
else
{
$data = array('upload_data' => $this->upload->data());
var_dump($data);
echo $config['file_name'] . $config['file_ext'];
}
my next question load helper form for ? or need load form to use library form_validation ?
$this->load->helper(array('form')); for ?
$this->load->library('form_validation'); this for validation rule