I wrote this small piece of code that shows a list of files given a folder name. It is written using VBScript so will work only on IE and FireFox(and maybe only on windows). But it is worth a look
<HTML>
<HEAD>
<SCRIPT LANGUAGE='VBSCRIPT'>
Sub showfiles()
On Error Resume Next
Dim fso, folder, files, sFolder, path
Set fso = CreateObject("Scripting.FileSystemObject")
sFolder = Document.getElementById("fdr").value
Set folder = fso.GetFolder(sFolder)
Set files = folder.Files
For each folderIdx In files
mydiv.innerhtml=mydiv.innerhtml & "<BR/> " & folderIdx.Name
Next
end sub
</SCRIPT>
</HEAD>
<BODY>
<INPUT id="fdr" TYPE="TEXT" VALUE="C:\" />
<INPUT TYPE="BUTTON" ONCLICK="showfiles()" value="show files" />
<DIV id="mydiv"></DIV>
</BODY>
</HTML>