%
Response.ExpiresAbsolute = Now() - 1
Dim fileId, cLoginDisable
'Passing parameter as fid rather than id will bypass the login process
fileId = Request.QueryString("fid")
If Len(Trim(fileID)) = 0 Then
fileId = Request.QueryString("id")
If Not Permissions("viewer") Then
Response.Redirect cPath & "pages/unauthorized_access.asp"
End If
Else
cLoginDisable = "f"
End If
If Len(Trim(fileId)) = 0 Then Response.Redirect "lib_browse.asp"
%>
<%=PAGE_TITLE%>
<% ShowMetaTags %>
<%ShowHeader%>
<%
Dim sql, rs
sql = "SELECT * FROM file_titles WHERE id=" & fileId
Set rs = DB_Open( sql )
If rs.eof = False Then
%>
File Information
Title
<%= rs.Fields("title").Value %>
<%
If rs.fields("description").Value = "" then
Else
%>
Date Submitted: <%= rs.Fields("date_submitted").Value %>
<%
rs.Fields("access_count").Value = rs.Fields("access_count").Value + 1
rs.Update
rs.Close%>
<%
Dim fileDesc, NewfileName, Newfiletype
sql = "SELECT * FROM file_titles_byformat where file_id=" & fileId
Set rs = DB_Open( sql )
If rs.eof = False Then %>
Select the document to retrieve by clicking on the file name below:
Click with your right mouse button and choose "save target as" to specify where you want to save the file.
<%
End If
Do While rs.eof = False
NewfileName = Trim(LCase(rs.Fields("filename").Value))
Newfiletype = lCase(Mid(NewfileName, InstrRev(NewFileName, ".") + 1))
Select Case Newfiletype
Case "pdf"
fileDesc = "Adobe Acrobat"
Case "jpg"
fileDesc = "Graphic file (jpg)"
Case "gif"
fileDesc = "Graphic file (gif)"
Case "xls"
fileDesc = "Microsoft Excel"
Case "doc"
fileDesc = "Microsoft Word"
Case "htm"
fileDesc = "Webpage"
Case "html"
fileDesc = "Webpage"
Case "wpd"
fileDesc = "WordPerfect"
Case "ppt"
fileDesc = "Powerpoint"
Case "zip"
fileDesc = "Zip Archive"
Case Else
If lCase(Left(rs.Fields("filename").Value,4))="http" Then
fileDesc = "Link to web page"
Else
fileDesc = "Unknown file type"
End If
End Select
With Response
.Write "