View Full Version : Intranet Hyperlink Generator Question
mobilemichael
06-14-2006, 11:29 AM
Well, I'm not sure if I'm wording the title correctly but I do think the people at this site can solve this question.
I am tasked with creating a webpage on a company server not accessible to the internet. There are too many folders and subfolders with various types of documents in each. I have googled and looked at various websites to find something that will automatically create hyperlinks to a file. I will be copy/paste/edit any hyperlink created and import them into a webpage for a graphical navigation through a shared drive to selected documents.
Any ideas would be greatly appreciated.
More data about your server is required.
mobilemichael
06-14-2006, 12:48 PM
Type: Network Drive
File System: NWFS
I'm thinking that whatever program or script that could work on a local hard drive trying to accomplish the same thing would work. I know using windows explorer is the normal way to navigate through a local hard drive, but they are wanting something that looks like a website to navigate to the same files that they could just simply use shortcuts for.
If I edited a hyperlink on a blank webpage to navagate to file.xls I can use any of the following three path's and it works fine using internet explorer.
\\DRIVE\VOL1\SHARDATA\MAIN_FOLDER\SUB_FOLDER\FILE.XLS
FILE:///H:/MAIN_FOLDER/SUB_FOLDER/FILE.XLS
H:\MAIN_FOLDER\SUB_FOLDER\FILE.XLS
Hope this helps
It doesn't.
"Network Drive" is not a real protocol. :) It's an abstraction laid over (I believe) several protocols in Microsoft Windows.
The filesystem on the server isn't all that useful, although it is interesting (NetWare FS? Is this a Novell NetWare server?).
I will presume that you're talking about the SMB (System Message Block) protocol here, which is the most common for use with Windows "Shared Drives," but I could be wrong -- your choice of filesystem causes me to wonder about that. In this case there is, insofar as I am aware, no way of executing scripts before sending the output to the client implemented on either of the two popular servers (Samba and Microsoft Windows Server). This makes the effect you wish to achieve virtually impossible with any degree of temporal accuracy. I would suggest running a protocol that does allow this in common implementations, such as HTTP or, I believe, FTP.
mobilemichael
06-14-2006, 02:21 PM
I must clarify a couple of things ... I'm not a computer specialist and it's not my server, and I'm just trying to get an initial path to those files, not something that runs continuous. I'm just trying to save myself time of creating literally hundreds of links. I understand that the beginning of the link may have to be edited, but not the complete link. Once I have a list of all the hyperlinks to the files, I will maintain it manually. I just want a simple plain page of links so I can copy them as I need to a web site design that I'm working on.
Aaah, that makes a lot more sense.
What scripting languages do you have available? Or must this be done with a binary? Do you have Java?
mobilemichael
06-14-2006, 03:24 PM
Php, htm, and java
PHP will be simplest, methinks...
<?php
function recurseDir($c) {
echo("<ul>");
$d = opendir($c);
while($f = readdir($d)) {
if(strpos($f, ".") === 0) continue;
$ff = $c . "/" . $f;
echo("<li><a href=\"$ff\">$ff</a>\n");
if(is_dir($ff)) recurseDir($ff);
echo("</li>");
}
echo("</ul>");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title>
The Head Doom Fish Recursor, by Twey
</title>
</head>
<body>
<p>
<?php
recurseDir(".");
?>
</p>
</body>
</html>It's in HTML format because it's easier to read. If you require it to be in text form, that's not too difficult; try this:
<?php
header("Content-Type: text/plain");
function recurseDir($c, $l = -1) {
++$l;
$d = opendir($c);
while($f = readdir($d)) {
if(strpos($f, ".") === 0) continue;
$ff = $c . "/" . $f;
for($i=0;$i<$l;$i++) echo(" ");
echo("$ff\n");
if(is_dir($ff)) recurseDir($ff, $l + 1);
}
--$l;
}
recurseDir(".");
?>Remove the header() call if you're running it from the command-line rather than a browser.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.