Jump to content

Accessing files outside of www folder


Crimpage

Recommended Posts

Hi All,

I use the e-dir script to show folder contents etc... I have modded the hell out of it for my own use, including having a variable starting directory.

In the script, you can set the start directory to be whatever you like, including something outside of the apache/iis wwwroot folder. However when the script generates the html link to the file it will look like it is a subdirectory of the wwwroot folder, and therefor the file does not exist. It's a little confusing.

Let say my wwwroot folder is at:
c:\wamp\www
and i have the script pointing my start directory to
d:\
the script will show everything from my D drive. all well and good. But, when I click on one of the files it links to:
http://server/file.jpg
which apache thinks is at c:\wamp\www\file.jpg

Is there anyway of making php or apache pull files from outsite of the wwwroot folder on the fly or does everything need to be within the wwwroot folder?

Cheers,
Dave
Link to comment
https://forums.phpfreaks.com/topic/34807-accessing-files-outside-of-www-folder/
Share on other sites

As far as I know, it can read them, but can't server them, hence being "Outside" the webroot.

There's no point in having private directories outside the webroot if they can be accessed from the web, kind of defeats the objective, don't you think :)

Regards
Huggie

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.