Display local folder content (sub folders & files (not hidden)) using JavaScript

Guys, slowly getting a solution that works for me via here, but still not completely there.  I work on a helpdesk and want to create a webpage that will display a htm/html page showing the content of multiple networked folders, such as

VAR: Folder path
NEW STARTER PROCESS
Folder 1
Folder 2
Doc 1
Doc 2
...
Doc 7

VAR: another folder path
LEAVERS PROCESS
Folder 1
Folder 2
Doc 1
Doc 2
...
Doc 7

with the folder and document links clickable to open in a new page.  Someone on here has helped part way, but only to display the content (files) of one folder.

This is what I have so far...

HTML
<html>
<head>
<script src="scripts/filelist.js"></script>
</head>
<BODY topmargin="0" leftmargin="0" onLoad="Scan()">
<Div>Source: 
<input size=50 type=text value="c:\" id=path name=path class="Field" >
<div id=outPut_c></div>
</div>

</body>
</html>

Open in new window


SCRIPT
var Fo =new ActiveXObject("Scripting.FileSystemObject");
var StrOut = new String();
var FileName = new String();
var Extention = new String();
var FilePath = new String();


function FindFile(FOo)
{
	var FSo = new Enumerator(FOo.Files);
	for(i=0;!FSo.atEnd();FSo.moveNext())
	{
		if(FileName == "*" ||  FSo.item().name.slice(0,FSo.item().name.lastIndexOf(".")).toLowerCase().indexOf(FileName)>-1)
			if(Extention == "*" || FSo.item().name.slice(FSo.item().name.lastIndexOf(".")+1).toLowerCase().indexOf(Extention)>-1){
			if (FSo.item().Attributes & 2 ){}
			else{
				StrOut += "<tr "+ ((i%2)? "":"bgcolor=#FFFFFF")  +"><td width=50%><font class=find>" + '<a href="file:///'+FSo.item().name+'">'+FSo.item().name + "</a></font></td><td width=25%><font class=find>" + FSo.item().type + "</font></td><td width=50%><font class=find>"+ String(FSo.item().size/(1024*1024)).slice(0,3) +" MB</font></td></tr>";
				i++
				}
			}
	}
}


function Scan()
{
	if(path.value.length>0 && Fo.FolderExists(path.value)){
		StrOut = "<table border=0 width=100% cellspacing=0>"
		FindFile(Fo.GetFolder(path.value));
		outPut_c.innerHTML = StrOut+"</table>";
		}
	else alert("Insert Correct Path Address");
}

Open in new window


Is it possible to call multiple folder contents and display in a webpage as it would seem the
outPut_c.innerHTML 

Open in new window

will only overwrite the existing display.
creativepresenceAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

creativepresenceAuthor Commented:
Obviously, if there is a better way to display mutliple folder content in a webpage, where the user can open the displayed folders\files.
0
Bernard S.CTOCommented:
- You might consider looking at a ready-to-run existing solution such as http://extplorer.sourceforge.net/ (written in js and php)

- you need to work at the DOM-level, so that your js codes adds content to your page innerHTML
So
-- initialize outPut_c.innerHTML, eg
            outPut_c.innerHTML = "<h1>Listing of files and directories</h1><hr>";

-- change
            outPut_c.innerHTML = StrOut+"</table>";
to
            outPut_c.innerHTML += StrOut+"</table>";
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Bernard S.CTOCommented:
Hi,

Where do you stand currently on the issue?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.