...

View Full Version : brainjar asp directory list script produces error



Errica
09-19-2007, 04:27 PM
Actually, I found a different script. Any way for this to be modified so that it hides this file (which I've named index.asp??


<html>
<head><title>File List</title>
</head>
<body>

<ol>
<%
Set myFileSys = Server.CreateObject("Scripting.FileSystemObject")
Set Folder = myFileSys.GetFolder(Server.MapPath("/ais"))
for each file in Folder.Files
FileName = Left(file.name, (Len(file.name) - 4)) 'drop the extension
FileSize = cint(file.size / 1024) 'convert into kilobytes and drop the decimal
Response.Write("<li><a href='/" & file.name & "'>" & FileName & "</a> - " & FileSize & " K<br>" & chr(13))
next

Set myFileSys = nothing
%>
</ol>
</body>
</html>

Spudhead
09-19-2007, 06:13 PM
well.... you can see that the file name is in the file.name property, right?

so maybe you could do something like....

if file.name = "index.asp" then
' do nothing
else
' do some stuff
end if



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum