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 to know whether the directory exists, use
var Fo = new ActiveXObject("Scripting.FileSystemObject");
Enumerators are an array of
File objects such that you can use methods to get special file or sub directory that are in defined path. Enumerators 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 is in current place of
Enumerator. Then, you can use
Files properties that are listed:
This article has no explicit license attached to it, but may contain usage terms in the article text or the download files themselves. If in doubt, please contact the author via the discussion board below.
A list of licenses authors might use can be found here.