Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I get location to open a directory? intranet/localhost issue

Status
Not open for further replies.

joelwenzel

Programmer
Jun 28, 2002
448
I have the following code in my header but it does not open the C directory when I use However, if I just go to the file (file.html) and open it, it immediately redirects to the c directory. Any idea of how I can get this code to work using the localhost directory (it is for an intranet site)

<script language="javascript">
window.location = 'file:///C:/';
</script>
 
do you want to browse the user's c: directory or the server's c: directory?

as written, you would be attempting to browse the user's c: directory, which could be considered a security risk.

if you want to browse the server, i would suggest enabling directory browsing on the appropriate directories in your server config.


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
I want the server directory. Ok, I really don't know to much about this. How do I change the settings in the server config? I only can find a web.config file.

How do I set the directory as readable?
 
depends on what webserver you're running.

iirc, web.config sounds like a .NET thing

if M$ IIS, it's in IIS Admin console, there's a checkbox for directory browsing (google "disable directory browsing iis")

if Apache:


-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top