Welcome Guest, Not a member yet? Register   Sign In
directory_map() not working returns bool(false)
#1

(This post was last modified: 01-27-2016, 06:04 AM by vilasgalave.)

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. '[font=Times New Roman]Invalid argument supplied for foreach()' [/font]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 [font=sans-serif]Property gallery folder .[/font]
[font=sans-serif]I'm new in codeigniter, any help will be appreciated.[/font]
[font=sans-serif]My folder structure is[/font]

[font=sans-serif][font=Monaco, Consolas, Courier, monospace]->Admin[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace]     -> application[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace]     -> assets[/font][/font][/font]
[font=sans-serif]          -> Property gallery[/font]
[font=sans-serif]              -> [font=Monaco, Consolas, Courier, monospace]Ganesh Kripa[/font][/font]
[font=sans-serif][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace][font=Monaco, Consolas, Courier, monospace]     [/font][font=Monaco, Consolas, Courier, monospace]-> [/font][font=Monaco, Consolas, Courier, monospace]system[/font][/font][/font][/font]
Reply
#2

If you look at the directory_map helper its path takes a ./ in front of the directory name.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

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

$map = directory_map('./'.$image_path);
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

its worked..! Thanks
Reply




Theme © iAndrew 2016 - Forum software by © MyBB