Filesystem object and virtual directories
I am using the filesystem object to walk through directories and output the
hierarchy in an XML file.
I have everything working except the ability to walk through virtual
directories.
When presented with a virtual directory the code should resolve the physical
directory and then set the folder object to the physical directory.
It appears to be resolving the physical directory but cannot set this
directory to the folder object.
I suspect this to be due to a security setting but am not familiar with what
would need to be changed to get the ASP code access to the physical
directory. The process is running under IIS and IIS has access. Is it
because the Filesystem object is running out of process and does not have
access to the physical drive?
See code below (this is a work in progress so please don't critique the
naming convention)
<% @language="jscript" %>
<%
var serverdirectory = Request.Querystring("dir");
var title = Request.Querystring("title");
if (Request.Querystring("initpage") > "")
{
var initpage = Request.Querystring("initpage");
}
else
{
var initpage = "about:blank";
}
var sxml = '<?xml version=\'' + '1.0' + '\'?>';
sxml = sxml + '<?xml:stylesheet TYPE=\'' + 'text/xsl' + '\'?>';
var extensionarray = new ActiveXObject("Scripting.Dictionary");
extensionarray.add(".pdf","documentadobe.gif");
extensionarray.add(".gif","documentimage.gif");
extensionarray.add(".jpg","documentimage.gif");
extensionarray.add(".htm","documenthtml.gif");
extensionarray.add(".asp","documentasp.gif");
var ignoreextensionarray = new ActiveXObject("Scripting.Dictionary");
ignoreextensionarray.add(".scc","source safe file");
ignoreextensionarray.add(".bak","backup file");
ignoreextensionarray.add(".xml","xml file");
ignoreextensionarray.add(".xsl","xsl file");
ignoreextensionarray.add(".css","css file");
ignoreextensionarray.add(".old","old file");
ignoreextensionarray.add(".js","javascript file");
ignoreextensionarray.add(".vbs","visual basic script file");
var ignorefolderarray = new ActiveXObject("Scripting.Dictionary");
ignorefolderarray.add("_vti_cnf","system folder");
ignorefolderarray.add("_vti_pvt","system folder");
ignorefolderarray.add("_borders","system folder");
ignorefolderarray.add("_derived","system folder");
ignorefolderarray.add("_private","system folder");
ignorefolderarray.add("_vti_script","system folder");
ignorefolderarray.add("_vti_txt","system folder");
var ignorefilearray = new ActiveXObject("Scripting.Dictionary");
ignorefilearray.add("Default","default directory file");
ignorefilearray.add("Navigator","navigator menu file");
var fso, f, f1, fc, s, mypath;
fso = new ActiveXObject("Scripting.FileSystemObject");
if (serverdirectory > '')
{
f = fso.GetFolder(Server.mapPath(serverdirectory));
sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
String.fromCharCode(10,13);
sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage + '\'/>' +
String.fromCharCode(10,13);
if (serverdirectory != '/')
{
mypath = serverdirectory;
}
else
{
mypath = '';
}
}
else
{
f = fso.GetFolder(Server.mapPath(".")+"/");
f1 = fso.GetFolder(fso.GetParentFolderName(f)+"/");
sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
String.fromCharCode(10,13);
sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage + '\'/>' +
String.fromCharCode(10,13);
mypath = ''
}
if (!ignorefolderarray.exists(f.name))
{
var fc = new Enumerator(f.files);
if (f.files.Count > 0 || f.subfolders.count > 0)
{
sxml = sxml + '<TOPICS TYPE=\''+f.name+'\'>' +
String.fromCharCode(10,13);
for (; !fc.atEnd(); fc.moveNext())
{
var myfullfilename =
Server.HTMLEncode(fso.GetFileName(fc.item())).toLowerCase();
var myfileextension =
myfullfilename.substr(myfullfilename.lastIndexOf('.'));
var myfilename =
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
werCase();
myfilename =
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
var imagestring = extensionarray.exists(myfileextension) ?
'<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
'<IMAGE>documentunknown.gif</IMAGE>';
if ((!ignoreextensionarray.exists(myfileextension) &&
!ignorefilearray.exists(myfilename)))
{
sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
+mypath+'\/'+myfullfilename+ '</URL><WINDOW>CONTENTS</WINDOW>' + imagestring
+ '</TOPIC>' + String.fromCharCode(10,13);
}
}
var thispath = serverdirectory;
dofolders(f,thispath);
sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
}
else
{
var thispath = serverdirectory;
dofolders(f,thispath);
}
}
sxml = sxml + '</TOPICLIST>';
sxsl = '/xml/navigator.xsl'
oxmldoc = Server.CreateObject('microsoft.xmldom');
oxmldoc.async = false;
oxmldoc.loadXML(sxml);
oxsldoc = Server.CreateObject('microsoft.xmldom');
oxsldoc.async = false;
oxsldoc.load(Server.mappath(sxsl));
var output = oxmldoc.transformNode(oxsldoc);
Response.write(output);
file://Response.write(sxml);
oxmldoc = null;
oxsldoc = null;
fso = null;
ignorefilearray = null;
ignorefolderarray = null;
ignoreextensionarray = null;
extensionarray = null;
function dofolders(fa,webpath)
{
var myfolders = new Enumerator(fa.subfolders);
if (webpath != '/')
{
var localpath = webpath;
}
else
{
var localpath = '';
}
if (myfolders.count != 0)
{
var tempsxml = '';
var filecounter = 0;
for (; !myfolders.atEnd(); myfolders.moveNext())
{
var thisfolder = myfolders.item();
if (!ignorefolderarray.exists(thisfolder.name))
{
var fc2 = new Enumerator(thisfolder.files);
// if (thisfolder.files.Count > 0 || thisfolder.subfolders.count > 0)
// {
filecounter = 0;
sxml = sxml + '<TOPICS TYPE=\''+thisfolder.name+'\'>' +
String.fromCharCode(10,13);
for (; !fc2.atEnd(); fc2.moveNext())
{
var myfullfilename =
Server.HTMLEncode(fso.GetFileName(fc2.item())).toLowerCase();
var myfileextension =
myfullfilename.substr(myfullfilename.lastIndexOf('.'));
var myfilename =
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
werCase();
myfilename =
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
var imagestring = extensionarray.exists(myfileextension) ?
'<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
'<IMAGE>documentunknown.gif</IMAGE>';
if ((!ignoreextensionarray.exists(myfileextension) &&
!ignorefilearray.exists(myfilename)))
{
sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
+localpath+'\/'+thisfolder.name+'\/'+myfullfilename+
'</URL><WINDOW>CONTENTS</WINDOW>' + imagestring + '</TOPIC>' +
String.fromCharCode(10,13);
filecounter=filecounter+1;
}
}
var thispath = localpath+'\/'+thisfolder.name
dofolders(thisfolder,thispath);
sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
// }
// else
// {
// var thispath = localpath+'\/'+thisfolder.name
// dofolders(thisfolder,thispath);
// }
}
}
}
}
%>
[8768 byte] By [
Gene Black] at [2007-11-9 15:36:09]

# 1 Re: Filesystem object and virtual directories
In addition, I forgot to mention that the virtual directories being listed
are located on a network drive.
"Gene Black" <geblack@att.net> wrote in message
news:3964d5aa@news.dev-archive.com...
> I am using the filesystem object to walk through directories and output
the
> hierarchy in an XML file.
>
> I have everything working except the ability to walk through virtual
> directories.
>
> When presented with a virtual directory the code should resolve the
physical
> directory and then set the folder object to the physical directory.
>
> It appears to be resolving the physical directory but cannot set this
> directory to the folder object.
>
> I suspect this to be due to a security setting but am not familiar with
what
> would need to be changed to get the ASP code access to the physical
> directory. The process is running under IIS and IIS has access. Is it
> because the Filesystem object is running out of process and does not have
> access to the physical drive?
>
> See code below (this is a work in progress so please don't critique the
> naming convention)
>
>
> <% @language="jscript" %>
> <%
> var serverdirectory = Request.Querystring("dir");
> var title = Request.Querystring("title");
> if (Request.Querystring("initpage") > "")
> {
> var initpage = Request.Querystring("initpage");
> }
> else
> {
> var initpage = "about:blank";
> }
>
> var sxml = '<?xml version=\'' + '1.0' + '\'?>';
> sxml = sxml + '<?xml:stylesheet TYPE=\'' + 'text/xsl' + '\'?>';
>
> var extensionarray = new ActiveXObject("Scripting.Dictionary");
> extensionarray.add(".pdf","documentadobe.gif");
> extensionarray.add(".gif","documentimage.gif");
> extensionarray.add(".jpg","documentimage.gif");
> extensionarray.add(".htm","documenthtml.gif");
> extensionarray.add(".asp","documentasp.gif");
>
> var ignoreextensionarray = new ActiveXObject("Scripting.Dictionary");
> ignoreextensionarray.add(".scc","source safe file");
> ignoreextensionarray.add(".bak","backup file");
> ignoreextensionarray.add(".xml","xml file");
> ignoreextensionarray.add(".xsl","xsl file");
> ignoreextensionarray.add(".css","css file");
> ignoreextensionarray.add(".old","old file");
> ignoreextensionarray.add(".js","javascript file");
> ignoreextensionarray.add(".vbs","visual basic script file");
>
> var ignorefolderarray = new ActiveXObject("Scripting.Dictionary");
> ignorefolderarray.add("_vti_cnf","system folder");
> ignorefolderarray.add("_vti_pvt","system folder");
> ignorefolderarray.add("_borders","system folder");
> ignorefolderarray.add("_derived","system folder");
> ignorefolderarray.add("_private","system folder");
> ignorefolderarray.add("_vti_script","system folder");
> ignorefolderarray.add("_vti_txt","system folder");
>
> var ignorefilearray = new ActiveXObject("Scripting.Dictionary");
> ignorefilearray.add("Default","default directory file");
> ignorefilearray.add("Navigator","navigator menu file");
>
> var fso, f, f1, fc, s, mypath;
> fso = new ActiveXObject("Scripting.FileSystemObject");
> if (serverdirectory > '')
> {
> f = fso.GetFolder(Server.mapPath(serverdirectory));
> sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
> String.fromCharCode(10,13);
> sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
> CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage + '\'/>'
+
> String.fromCharCode(10,13);
>
> if (serverdirectory != '/')
> {
> mypath = serverdirectory;
> }
> else
> {
> mypath = '';
> }
> }
> else
> {
> f = fso.GetFolder(Server.mapPath(".")+"/");
> f1 = fso.GetFolder(fso.GetParentFolderName(f)+"/");
> sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
> String.fromCharCode(10,13);
> sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
> CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage + '\'/>'
+
> String.fromCharCode(10,13);
> mypath = ''
> }
>
>
> if (!ignorefolderarray.exists(f.name))
> {
> var fc = new Enumerator(f.files);
> if (f.files.Count > 0 || f.subfolders.count > 0)
> {
> sxml = sxml + '<TOPICS TYPE=\''+f.name+'\'>' +
> String.fromCharCode(10,13);
> for (; !fc.atEnd(); fc.moveNext())
> {
> var myfullfilename =
> Server.HTMLEncode(fso.GetFileName(fc.item())).toLowerCase();
> var myfileextension =
> myfullfilename.substr(myfullfilename.lastIndexOf('.'));
> var myfilename =
>
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
> werCase();
> myfilename =
>
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
> var imagestring = extensionarray.exists(myfileextension) ?
> '<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
> '<IMAGE>documentunknown.gif</IMAGE>';
> if ((!ignoreextensionarray.exists(myfileextension) &&
> !ignorefilearray.exists(myfilename)))
> {
> sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
> +mypath+'\/'+myfullfilename+ '</URL><WINDOW>CONTENTS</WINDOW>' +
imagestring
> + '</TOPIC>' + String.fromCharCode(10,13);
> }
> }
>
> var thispath = serverdirectory;
> dofolders(f,thispath);
> sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
> }
> else
> {
> var thispath = serverdirectory;
> dofolders(f,thispath);
> }
> }
>
>
>
>
> sxml = sxml + '</TOPICLIST>';
>
> sxsl = '/xml/navigator.xsl'
>
> oxmldoc = Server.CreateObject('microsoft.xmldom');
> oxmldoc.async = false;
> oxmldoc.loadXML(sxml);
>
> oxsldoc = Server.CreateObject('microsoft.xmldom');
> oxsldoc.async = false;
> oxsldoc.load(Server.mappath(sxsl));
>
> var output = oxmldoc.transformNode(oxsldoc);
> Response.write(output);
> file://Response.write(sxml);
> oxmldoc = null;
> oxsldoc = null;
> fso = null;
> ignorefilearray = null;
> ignorefolderarray = null;
> ignoreextensionarray = null;
> extensionarray = null;
>
> function dofolders(fa,webpath)
> {
> var myfolders = new Enumerator(fa.subfolders);
>
> if (webpath != '/')
> {
> var localpath = webpath;
> }
> else
> {
> var localpath = '';
> }
>
> if (myfolders.count != 0)
> {
> var tempsxml = '';
> var filecounter = 0;
> for (; !myfolders.atEnd(); myfolders.moveNext())
> {
> var thisfolder = myfolders.item();
> if (!ignorefolderarray.exists(thisfolder.name))
> {
> var fc2 = new Enumerator(thisfolder.files);
> // if (thisfolder.files.Count > 0 || thisfolder.subfolders.count > 0)
> // {
> filecounter = 0;
> sxml = sxml + '<TOPICS TYPE=\''+thisfolder.name+'\'>' +
> String.fromCharCode(10,13);
> for (; !fc2.atEnd(); fc2.moveNext())
> {
> var myfullfilename =
> Server.HTMLEncode(fso.GetFileName(fc2.item())).toLowerCase();
> var myfileextension =
> myfullfilename.substr(myfullfilename.lastIndexOf('.'));
> var myfilename =
>
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
> werCase();
> myfilename =
>
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
> var imagestring = extensionarray.exists(myfileextension) ?
> '<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
> '<IMAGE>documentunknown.gif</IMAGE>';
> if ((!ignoreextensionarray.exists(myfileextension) &&
> !ignorefilearray.exists(myfilename)))
> {
> sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
> +localpath+'\/'+thisfolder.name+'\/'+myfullfilename+
> '</URL><WINDOW>CONTENTS</WINDOW>' + imagestring + '</TOPIC>' +
> String.fromCharCode(10,13);
> filecounter=filecounter+1;
> }
> }
>
> var thispath = localpath+'\/'+thisfolder.name
> dofolders(thisfolder,thispath);
> sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
> // }
> // else
> // {
> // var thispath = localpath+'\/'+thisfolder.name
> // dofolders(thisfolder,thispath);
> // }
>
> }
> }
> }
> }
> %>
>
>
>
>
>
# 2 Re: Filesystem object and virtual directories
OK, I found out that Software Artisans SAFileManager allows a LogonUser
method on its filesystemobject which enables me to get access to my virtual
directories located on other drives.
"Gene Black" <geblack@att.net> wrote in message
news:3965dcc5@news.dev-archive.com...
> In addition, I forgot to mention that the virtual directories being listed
> are located on a network drive.
>
>
> "Gene Black" <geblack@att.net> wrote in message
> news:3964d5aa@news.dev-archive.com...
> > I am using the filesystem object to walk through directories and output
> the
> > hierarchy in an XML file.
> >
> > I have everything working except the ability to walk through virtual
> > directories.
> >
> > When presented with a virtual directory the code should resolve the
> physical
> > directory and then set the folder object to the physical directory.
> >
> > It appears to be resolving the physical directory but cannot set this
> > directory to the folder object.
> >
> > I suspect this to be due to a security setting but am not familiar with
> what
> > would need to be changed to get the ASP code access to the physical
> > directory. The process is running under IIS and IIS has access. Is it
> > because the Filesystem object is running out of process and does not
have
> > access to the physical drive?
> >
> > See code below (this is a work in progress so please don't critique the
> > naming convention)
> >
> >
> > <% @language="jscript" %>
> > <%
> > var serverdirectory = Request.Querystring("dir");
> > var title = Request.Querystring("title");
> > if (Request.Querystring("initpage") > "")
> > {
> > var initpage = Request.Querystring("initpage");
> > }
> > else
> > {
> > var initpage = "about:blank";
> > }
> >
> > var sxml = '<?xml version=\'' + '1.0' + '\'?>';
> > sxml = sxml + '<?xml:stylesheet TYPE=\'' + 'text/xsl' + '\'?>';
> >
> > var extensionarray = new ActiveXObject("Scripting.Dictionary");
> > extensionarray.add(".pdf","documentadobe.gif");
> > extensionarray.add(".gif","documentimage.gif");
> > extensionarray.add(".jpg","documentimage.gif");
> > extensionarray.add(".htm","documenthtml.gif");
> > extensionarray.add(".asp","documentasp.gif");
> >
> > var ignoreextensionarray = new ActiveXObject("Scripting.Dictionary");
> > ignoreextensionarray.add(".scc","source safe file");
> > ignoreextensionarray.add(".bak","backup file");
> > ignoreextensionarray.add(".xml","xml file");
> > ignoreextensionarray.add(".xsl","xsl file");
> > ignoreextensionarray.add(".css","css file");
> > ignoreextensionarray.add(".old","old file");
> > ignoreextensionarray.add(".js","javascript file");
> > ignoreextensionarray.add(".vbs","visual basic script file");
> >
> > var ignorefolderarray = new ActiveXObject("Scripting.Dictionary");
> > ignorefolderarray.add("_vti_cnf","system folder");
> > ignorefolderarray.add("_vti_pvt","system folder");
> > ignorefolderarray.add("_borders","system folder");
> > ignorefolderarray.add("_derived","system folder");
> > ignorefolderarray.add("_private","system folder");
> > ignorefolderarray.add("_vti_script","system folder");
> > ignorefolderarray.add("_vti_txt","system folder");
> >
> > var ignorefilearray = new ActiveXObject("Scripting.Dictionary");
> > ignorefilearray.add("Default","default directory file");
> > ignorefilearray.add("Navigator","navigator menu file");
> >
> > var fso, f, f1, fc, s, mypath;
> > fso = new ActiveXObject("Scripting.FileSystemObject");
> > if (serverdirectory > '')
> > {
> > f = fso.GetFolder(Server.mapPath(serverdirectory));
> > sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
> > String.fromCharCode(10,13);
> > sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
> > CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage +
'\'/>'
> +
> > String.fromCharCode(10,13);
> >
> > if (serverdirectory != '/')
> > {
> > mypath = serverdirectory;
> > }
> > else
> > {
> > mypath = '';
> > }
> > }
> > else
> > {
> > f = fso.GetFolder(Server.mapPath(".")+"/");
> > f1 = fso.GetFolder(fso.GetParentFolderName(f)+"/");
> > sxml = sxml + '<TOPICLIST TYPE=\'' + f.name + '\'>' +
> > String.fromCharCode(10,13);
> > sxml = sxml + '<CONTENTLINK SHOWALL=\'0\' RESIZEBUTTON=\'0\'
> > CLOSEWINDOW=\'0\' TITLE=\'' + title + '\' CONTENT=\'' + initpage +
'\'/>'
> +
> > String.fromCharCode(10,13);
> > mypath = ''
> > }
> >
> >
> > if (!ignorefolderarray.exists(f.name))
> > {
> > var fc = new Enumerator(f.files);
> > if (f.files.Count > 0 || f.subfolders.count > 0)
> > {
> > sxml = sxml + '<TOPICS TYPE=\''+f.name+'\'>' +
> > String.fromCharCode(10,13);
> > for (; !fc.atEnd(); fc.moveNext())
> > {
> > var myfullfilename =
> > Server.HTMLEncode(fso.GetFileName(fc.item())).toLowerCase();
> > var myfileextension =
> > myfullfilename.substr(myfullfilename.lastIndexOf('.'));
> > var myfilename =
> >
>
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
> > werCase();
> > myfilename =
> >
>
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
> > var imagestring = extensionarray.exists(myfileextension) ?
> > '<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
> > '<IMAGE>documentunknown.gif</IMAGE>';
> > if ((!ignoreextensionarray.exists(myfileextension) &&
> > !ignorefilearray.exists(myfilename)))
> > {
> > sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
> > +mypath+'\/'+myfullfilename+ '</URL><WINDOW>CONTENTS</WINDOW>' +
> imagestring
> > + '</TOPIC>' + String.fromCharCode(10,13);
> > }
> > }
> >
> > var thispath = serverdirectory;
> > dofolders(f,thispath);
> > sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
> > }
> > else
> > {
> > var thispath = serverdirectory;
> > dofolders(f,thispath);
> > }
> > }
> >
> >
> >
> >
> > sxml = sxml + '</TOPICLIST>';
> >
> > sxsl = '/xml/navigator.xsl'
> >
> > oxmldoc = Server.CreateObject('microsoft.xmldom');
> > oxmldoc.async = false;
> > oxmldoc.loadXML(sxml);
> >
> > oxsldoc = Server.CreateObject('microsoft.xmldom');
> > oxsldoc.async = false;
> > oxsldoc.load(Server.mappath(sxsl));
> >
> > var output = oxmldoc.transformNode(oxsldoc);
> > Response.write(output);
> > file://Response.write(sxml);
> > oxmldoc = null;
> > oxsldoc = null;
> > fso = null;
> > ignorefilearray = null;
> > ignorefolderarray = null;
> > ignoreextensionarray = null;
> > extensionarray = null;
> >
> > function dofolders(fa,webpath)
> > {
> > var myfolders = new Enumerator(fa.subfolders);
> >
> > if (webpath != '/')
> > {
> > var localpath = webpath;
> > }
> > else
> > {
> > var localpath = '';
> > }
> >
> > if (myfolders.count != 0)
> > {
> > var tempsxml = '';
> > var filecounter = 0;
> > for (; !myfolders.atEnd(); myfolders.moveNext())
> > {
> > var thisfolder = myfolders.item();
> > if (!ignorefolderarray.exists(thisfolder.name))
> > {
> > var fc2 = new Enumerator(thisfolder.files);
> > // if (thisfolder.files.Count > 0 || thisfolder.subfolders.count > 0)
> > // {
> > filecounter = 0;
> > sxml = sxml + '<TOPICS TYPE=\''+thisfolder.name+'\'>' +
> > String.fromCharCode(10,13);
> > for (; !fc2.atEnd(); fc2.moveNext())
> > {
> > var myfullfilename =
> > Server.HTMLEncode(fso.GetFileName(fc2.item())).toLowerCase();
> > var myfileextension =
> > myfullfilename.substr(myfullfilename.lastIndexOf('.'));
> > var myfilename =
> >
>
myfullfilename.substr(0,(myfullfilename.length-myfileextension.length)).toLo
> > werCase();
> > myfilename =
> >
>
myfilename.substr(0,1).toUpperCase()+myfilename.substr(1,myfilename.length);
> > var imagestring = extensionarray.exists(myfileextension) ?
> > '<IMAGE>'+extensionarray(myfileextension)+'</IMAGE>' :
> > '<IMAGE>documentunknown.gif</IMAGE>';
> > if ((!ignoreextensionarray.exists(myfileextension) &&
> > !ignorefilearray.exists(myfilename)))
> > {
> > sxml = sxml + '<TOPIC><TITLE>' +myfilename+ '</TITLE><URL>'
> > +localpath+'\/'+thisfolder.name+'\/'+myfullfilename+
> > '</URL><WINDOW>CONTENTS</WINDOW>' + imagestring + '</TOPIC>' +
> > String.fromCharCode(10,13);
> > filecounter=filecounter+1;
> > }
> > }
> >
> > var thispath = localpath+'\/'+thisfolder.name
> > dofolders(thisfolder,thispath);
> > sxml = sxml + '</TOPICS>' + String.fromCharCode(10,13);
> > // }
> > // else
> > // {
> > // var thispath = localpath+'\/'+thisfolder.name
> > // dofolders(thisfolder,thispath);
> > // }
> >
> > }
> > }
> > }
> > }
> > %>
> >
> >
> >
> >
> >
>
>
