Showing files in a Directory

Im trying to open up a directory and show the files on my web pages.<br />
Works with no problem in IE6 but cant get it to work in Netscape 7.0 and Netscape 4.77. The Directory sits on a Windows 2000 Info Server.<br />
<br />
Please advise:<br />
<br />
<br />
<a href=http://www.webdeveloper.com/forum/archive/index.php/"file:////myinfoServer/myDirectory/">Open and view files in myDirectory</a><!--content-->The following should work, however, if there is an "index.html" file, it will display that instead.<br />
<br />
<br />
<!-- STEP ONE: Paste this code into the HEAD of your HTML document --><br />
<br />
<HEAD><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Original: Dan Worsham --><br />
<br />
<!-- Begin<br />
var myloc = window.location.href;<br />
var locarray = myloc.split("/");<br />
delete locarray[(locarray.length-1)];<br />
var arraytext = locarray.join("/");<br />
// End --><br />
</script><br />
</HEAD><br />
<br />
<br />
<!-- STEP TWO: Copy this code into the BODY of your HTML document --><br />
<br />
<BODY><br />
<br />
<center><br />
<form><br />
<input type=button value="Show Current Directory Listing (Or Index.html Page)" onClick="window.location=arraytext;"><br />
</form><br />
</center><!--content-->Thanks, but where does the actual Directory name go?<br />
<br />
<br />
<HEAD><br />
<br />
<SCRIPT LANGUAGE="JavaScript"><br />
<!-- Original: Dan Worsham --><br />
<br />
<!-- Begin<br />
var myloc = 'file:////myinfoServer/myDirectory/'; //DOES DIRECTORY NAME GO HERE?<br />
var locarray = myloc.split("/");<br />
delete locarray[(locarray.length-1)];<br />
var arraytext = locarray.join("/");<br />
// End --><br />
</script><br />
</HEAD><br />
<br />
<br />
<!-- STEP TWO: Copy this code into the BODY of your HTML document --><br />
<br />
<BODY><br />
<br />
<center><br />
<form><br />
<input type=button value="Show Current Directory Listing (Or Index.html Page)" onClick="window.location=arraytext;"><br />
</form><br />
</center><!--content-->It will list the current directory, i.e. the directory that has the page with the script on it.<br />
<br />
Lee<!--content-->How do I get it to list another Directory? The directory I want is located on a different Server.<!--content-->You could put the script on a page on the other server and just link to it.<!--content-->This syntax works with Firefox:<br />
<br />
file://///servername/sharename/rootdirname<!--content-->
 
Back
Top