redirect.asp
来自「绿叶oa系统办公自动化 2008.工作日志管理,文件管理」· ASP 代码 · 共 89 行
ASP
89 行
<%
Response.ExpiresAbsolute=now()-1
Response.CacheControl="no-cache"
%>
<%
MM_authorizedUsers=""
MM_authFailedURL="../../index.asp"
MM_grantAccess=false
If Session("userssdfgfhtrh") <> "" Then
If (true Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<!--#include file="../../Connections/oavbsconn.asp" -->
<%
Dim r__MMColParam
r__MMColParam = "1"
If (Request("ID") <> "") Then
r__MMColParam = Request("ID")
End If
%>
<%
Dim r
Dim r_numRows
Set r = Server.CreateObject("ADODB.Recordset")
r.ActiveConnection = MM_oavbsconn_STRING
r.Source = "SELECT 文件路径 FROM shouwenfiles WHERE ID = " + Replace(r__MMColParam, "'", "''") + ""
r.CursorType = 0
r.CursorLocation = 2
r.LockType = 1
r.Open()
r_numRows = 0
%>
<%if not r.eof or not r.bof then%>
<%dim p
p=r("文件路径")
%><%
r.Close()
Set r = Nothing
%>
<%else%>
<%
r.Close()
Set r = Nothing
%>
<script>
{
alert("文件数据不存在...");history.go(-1)
}
</script>
<%response.end()
end if%>
<%dim id,url,fname
id=request("id")
url=p
fname=request("fname")
%>
<%
Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
on error resume next
If not objFSO.FileExists(Server.MapPath(url)) Then
%>
<script>
{
alert("友情提醒:,您访问的."&fname&"文件含有,.;':%4#等字符,系统将以下载输出方式打开;请选择下载保存即可。")
}</script>
<%
response.redirect "downfile.asp?id="&cint(id)
response.end()
End If%>
<%response.redirect url%>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?