CodeIgniter Forums
directory_map() not working returns bool(false) - 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: directory_map() not working returns bool(false) (/showthread.php?tid=64204)



directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

I have different image folders under 'Property gallery' directory e.g. 'Property gallery/pro_1'. Here I want to fetch full paths of all the images inside the specified folder. I used directory_map() but it doesn't return anything. 
My code is: 
Code:
$image_path = $row['image_path'];//stored in database as 'Property gallery/Ganesh Kripa/'
/*--get all images in directory--*/
$map = directory_map($image_path);
var_dump($map);
//print_r($map);
foreach ($map as $result)
{
       $get_result = $image_path.$result;
    array_push($img_array,$get_result);
}


 var_dump($map) returns bool(false) and then error at foreach loop i.e. 'Invalid argument supplied for foreach()' occurs. 
I set to autoload the url, form, path and directory helpers and my base url is 
Code:
http://localhost:8081/SVN_propertybooking/branches/dev/Admin/
 
And under Admin directory there is Property gallery folder .
I'm new in codeigniter, any help will be appreciated.
My folder structure is

->Admin
     -> application
     -> assets
          -> Property gallery
              -> Ganesh Kripa
     -> system


RE: directory_map() not working returns bool(false) - InsiteFX - 01-27-2016

If you look at the directory_map helper its path takes a ./ in front of the directory name.


RE: directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

I tried but still not working same error occurs. Please see my newly edited question, added folder structure.


RE: directory_map() not working returns bool(false) - InsiteFX - 01-27-2016

$map = directory_map('./'.$image_path);


RE: directory_map() not working returns bool(false) - vilasgalave - 01-27-2016

its worked..! Thanks