Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-19-2007, 04:27 PM #1
- Join Date
- Aug 2005
- Thanked 0 Times in 0 Posts
brainjar asp directory list script produces error
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>
Last edited by Errica; 09-19-2007 at 04:33 PM. Reason: Found a different script
09-19-2007, 06:13 PM #2
- Join Date
- Jun 2002
- London, UK
- Thanked 110 Times in 109 Posts
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
' do some stuff