• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I can't get it to view files i a directory!

#1
[eluser]behnampmdg3[/eluser]
Hello;

Why can't I see anything? I need to see the files in this directory. The directory exists and is accessible. I dont get an error either!

Code:
$directory_url = base_url('upload/server/php/files');
$this->load->helper('directory');
$one = directory_map($directory_url);
$two = directory_map($directory_url, FALSE, TRUE);
$three = directory_map($directory_url, 1);
print_r($one);
echo "<hr />";
print_r($two);
echo "<hr />";
print_r($three);
echo "<hr />";
echo $directory_url;

Thanks

#2
[eluser]CroNiX[/eluser]
Because you're not accessing a directory...you're accessing a URL (using base_url())... Try using the full path to the dir.

#3
[eluser]behnampmdg3[/eluser]
[quote author="CroNiX" date="1357956015"]Because you're not accessing a directory...you're accessing a URL (using base_url())... Try using the full path to the dir.
[/quote]Would you please explain? I tired this below but no difference:
Code:
$directory_url = "http://nickdavis.com.au/sincity/website_admin/upload/server/php/files";
$this->load->helper('directory');
$one = directory_map($directory_url);

echo $directory_url;echo "<br />";
var_dump($one);
It prints:

Code:
http://nickdavis.com.au/sincity/website_admin/upload/server/php/files
bool(false)

Heres the folder

Thank you

#4
[eluser]CroNiX[/eluser]
Yes, as I said that's a url. It starts with http. You need the local file path on the server (which is what that url is accessing).
Code:
/home/users/or/whatever/sincity/website_admin/upload/server/php/files

See the examples in the docs for the directory helper. It's not using a url.

#5
[eluser]behnampmdg3[/eluser]
[quote author="CroNiX" date="1357957909"]Yes, as I said that's a url. It starts with http. You need the local file path on the server (which is what that url is accessing).
Code:
/home/users/or/whatever/sincity/website_admin/upload/server/php/files

See the examples in the docs for the directory helper. It's not using a url.[/quote]Many thanks. Got it working.

Cheers


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.