<% ' ***** Feel free to edit the above table tag
' ***** Build path navigation
aNames = Split( sSubFolder , "/")
If bShowPath Then
If UBound( aNames ) > 0 Or bShowRoot Then %>
| <%= sFont %> |
<%= sFont %>
"><%= Left(sDirectory,len(sDirectory)-1) %>
<% End If
For count = 0 To UBound( aNames ) -1
aURL = aURL & aNames(count) & "/"
%> <%= sChevron %> ?dir=<%= Server.URLEncode( aURL ) %>"><%= aNames(count) %><%
Next %> |
<%
End If
For count = 0 To UBound( aNames ) -2
aDirUp = aDirUp & aNames(count) & "/"
Next %>
| ?dir=<%= Server.URLEncode( aDirUp ) %>">Ç |
<%= sColFont %> Filename: |
<%= sColFont %> Size: |
<%= sColFont %> File Type: |
<%= sColFont %> Date created: |
<%
' ***** Iterate through the subfolders in our shared folder.
For Each objFile In objFolder.SubFolders
' ***** Alternate between these two row colors.
If iAlternate = 0 Then
Response.Write "
"
iAlternate = 1
Else
Response.Write "
"
iAlternate = 0
End If
' ***** Display folder with link to navigate
%> | 0 |
<%= sFont %> ?dir=<%= Server.URLEncode( sSubFolder & objFile.Name )%>"><%= objFile.Name %> |
<%= sFont %> <%= ByteConversion( objFile.Size ) %> |
<%= sFont %> <%= objFile.Type %> |
<%= sFont %> <%= objFile.DateCreated %> |
<%
' ***** Next Folder
Next
' ***** Iterate through the files in our shared folder / subfolder.
For Each objFile In objFolder.Files
sFileName = objFile.name
' ***** Only continue if it's a valid extension
If ( IsValidFile (sFileName) ) Then
' ***** Alternate between these two row colors.
' We'll use the same counter variable to continue alternating between
' the light / dark shade according to the previous folder row color.
If iAlternate = 0 Then
Response.Write ""
iAlternate = 1
Else
Response.Write "
"
iAlternate = 0
End If
' ***** Display file with link to execute / dowload.
%> | < |
<%= sFont %> <%= sFileName %> |
<%= sFont %> <%= ByteConversion( objFile.Size ) %> |
<%= sFont %> <%= objFile.Type %> |
<%= sFont %> <%= objFile.DateCreated %> |
<%
End If
' ***** Next File
Next
' ***** Clean up those nasty memory leaks
Set objFileObject = Nothing
Set objFolder = Nothing
' ***** Iterate through and approve extensions
Function IsValidFile(FileName)
If Not AllowExt <> "" Or LCase( AllowExt ) = "all" Then
IsValidFile = True
Else
aAllowExt = Split( AllowExt & "," , ",")
IsValidFile = False
For iCnt = 0 To UBound( aAllowExt ) -1
If Right( FileName , Len( FileName ) - InStrRev( FileName , "." ) ) = Trim(aAllowExt( iCnt )) Then IsValidFile = True
Next
End If
If DenyExt <> "" Then
aDenyExt = Split( DenyExt & "," , ",")
For iCnt = 0 To UBound( aDenyExt ) -1
If Right( FileName , Len( FileName ) - InStrRev( FileName , "." ) ) = Trim(aDenyExt( iCnt )) Then IsValidFile = False
Next
End If
End Function
' ***** Display friendly byte size
Function ByteConversion(NumberOfBytes)
If NumberOfBytes < 1024 Then
sDisplayBytes = NumberOfBytes & " Bytes"
End If
If NumberOfBytes >= 1024 Then
sDisplayBytes = FormatNumber( NumberOfBytes / 1024, 2) & " KB"
End If
If NumberOfBytes > 1048576 Then
sDisplayBytes = FormatNumber( NumberOfBytes / 1048576, 2) & " MB"
End If
Response.Write sDisplayBytes
End Function
' ***** Did we encounter an Error?
If Err <> 0 Or sError <> "" Then
Response.Write "| ERROR: " & sError & Space(1) & "ASP: " & Err.description & "; |
"
End If
%>