|
<%
' Code heavily modified, but original credits included below
' - EJA (July 2002)
'########################################################
'## ##
'## Anil Kumar November 2001 ##
'## alpha_kappa@rediffmail.com ##
'## makrisoft.cjb.net | anilkumar.itgo.com ##
'## ##
'########################################################
If Request.QueryString("fold")<>"" then
pthFolder=pthFolder & "/" & Request.QueryString("fold")
else
pthFolder="/fpc/docs/electrical_mechanical/"
end if
Set fso = Server.CreateObject("Scripting.FileSystemObject")
'get all required info
sParentFolder = fso.GetParentFolderName(pthFolder)
If sParentFolder = "" then sParentFolder = "/"
If left(sParentFolder,1) = "/" or left(sParentFolder,1) = "\" then sParentFolder = Mid(sParentFolder,2)
sBackURL = "files.asp?fold=" & sParentFolder
dim FolderSize
FolderSize=0
Set Folder = fso.GetFolder(Server.MapPath(pthFolder))
'correct the pthFolder variable if it starts with a slash
'we will not be using the mappath method anymore, so we can discard the slash
If left(pthFolder,1) = "/" or left(pthFolder,1) = "\" then pthFolder = Mid(pthFolder,2)
' if the folder name does not end with a slash, then add a slash
If len(pthFolder) > 0 and right(pthFolder,1) <> "/" and right(pthFolder,1) <> "\" then pthFolder = pthFolder & "/"
' list of files
' removed folder path from top of page fileListName = "List of Files in '" & right(pthFolder, len(pthFolder)-9) & "' "
if right(pthFolder, len(pthFolder)-9) = "electrical_mechanical/electrical/" then fileListName = "Electrical"
if right(pthFolder, len(pthFolder)-9) = "electrical_mechanical/mechanical/" then fileListName = "Mechanical"
Response.Write("" & fileListName)
Response.Write(" ")
if pthFolder <> "fpc/fpc/docs/design_guidelines/" then
Response.Write(" | ")
Response.Write("")
Response.Write("| File Name | ")
if not right(pthFolder, len(pthFolder)-9) = "electrical_mechanical/electrical/" and not right(pthFolder, len(pthFolder)-9) = "electrical_mechanical/mechanical/" then
'Only show filename for spec pages
end if
Response.write(" ")
end if
for each item in Folder.files
if (right(item.name, 4) <> ".asp") and (right(item.name, 4) <> ".LCK") and (right(item.name, 4) <> ".css") then
If item.Size>512 then
FileSize=Clng(item.Size/1024) & " kb"
else
FileSize=item.Size & " bytes"
end if
%>
<%
FolderSize=FolderSize + Clng(item.Size/1024)
end if
next
' list all folders
for each item in Folder.SubFolders
if (left(item.name, 1) <> "_") and item.name <> "img" and item.name <> "test" then %>
<% end if
next
Response.Write(" ")
set fso = nothing
set Folder = nothing
%>
<%
function fit(text,length)
' fix word wrap
If len(text) > (length-3) then
text = left(text, (length-3) )
text = text & "..."
fit = text
else
fit = text
end if
end function
%>
<% else
response.redirect "login.asp"
end if %>
|