Maybe you want to have list of server or client files in your web page
to uploading or downloading or changing . JScript allow you to do this. You can
capture all files type , size , properties in all directories and use them
easily. In this sample I use this technique for searching files in local hard drive.
Necessary Attention: your browser should have access to run ActiveX
objects. If receive a error message telling "Automatic Server Can't Create Object"
you most go to Internet Option and in security tab select custom level in Local
part and change options to get effect.
For working with Files and directory you should make a server object as
Scripting.FileSystemObject then with
GetDirectory() method can get a directory
object. If you want know the directory is use
var Fo = new ActiveXObject("Scripting.FileSystemObject");
Enumerators are an array of Directory or File objects such that you can use methods to get special file or sub directory that are in
defined path. Enumerator have some methods I have called like
moveNext() in my sample.
var FSo = new Enumerator(FOo.Files);
Files Object Properties
For getting a object that is in Enumerator object you must use
item() and it
returns a file or directory object that are in current place of Enumerator.
Then you can use Files properties that are listed.
FSo.item().name FSo.item().type FSo.item().size