php - Codeigniter get_file_info() returns filename as false -
i building codeigniter based file browser having problem file information.
i have loaded helpers:
$this->load->helper('file'); $this->load->helper('directory'); when called var_dump(get_file_info('gui/default/uploads/profile_200x200.jpg')); here result: (note path relative site_url())
array (size=4)   'name' => boolean false   'server_path' => string 'gui/default/uploads/subfold/profile_200x200.jpg' (length=47)   'size' => int 9714   'date' => int 1386054354 but when called get_filenames() or get_dir_file_info() same built-in file helper displays filenames correctly. experience or idea causes this?
due bug function (read here) use workaround:
$file = 'gui/default/uploads/profile_200x200.jpg'; $fileinfo = get_file_info($file); if(!$fileinfo['name']) $fileinfo['name'] = basename($file); 
Comments
Post a Comment