Ok I have created a FileSystemObject and successfully retrieved the folder I want using GetFolder().
However I cannot iterate through the .Files collection using JavaScript (not JScript). Has anyone done this??? Help!!!
Here is my code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var strAppFolder = new String(Server.MapPath("index.asp"));
var fso = Server.CreateObject("Scripting.FileSystemObject");
var fldAppFolder;
//Get the site root folder
strAppFolder = strAppFolder.substr(0, strAppFolder.search(/index.asp/gi));
strAppFolder += "applications";
//Check if the applications folder exists
if(fso.FolderExists(strAppFolder) == false) {
fso.CreateFolder(strAppFolder);
}
fldAppFolder = fso.GetFolder(strAppFolder);
%>
<%
var fileList = new Array(fldAppFolder.Files);
for(i=0;i<fileList.Count;i++)
Response.Write(fileList[i].Item());
%>
I know I am supposed to supply a key to the .Item() property but how the heck am I supposed to know what the key is? I just want to get a darn file listing.
However I cannot iterate through the .Files collection using JavaScript (not JScript). Has anyone done this??? Help!!!
Here is my code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%>
<%
var strAppFolder = new String(Server.MapPath("index.asp"));
var fso = Server.CreateObject("Scripting.FileSystemObject");
var fldAppFolder;
//Get the site root folder
strAppFolder = strAppFolder.substr(0, strAppFolder.search(/index.asp/gi));
strAppFolder += "applications";
//Check if the applications folder exists
if(fso.FolderExists(strAppFolder) == false) {
fso.CreateFolder(strAppFolder);
}
fldAppFolder = fso.GetFolder(strAppFolder);
%>
<%
var fileList = new Array(fldAppFolder.Files);
for(i=0;i<fileList.Count;i++)
Response.Write(fileList[i].Item());
%>
I know I am supposed to supply a key to the .Item() property but how the heck am I supposed to know what the key is? I just want to get a darn file listing.
Comment