📄 downloadfile.asp
字号:
<!-- #include file="const.asp" -->
<%
call opendb()
checkuser()
%>
<html>
<head>
<title><%=sitename%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td align="center" valign="middle">
<%
dim id,sql,rs,clicked,filepath,typ
typ=0
id=trim1(request.QueryString("id"))
if id="" then
call closedb()
call msg("缺少参数!")
end if
if len(id)>15 or instr(id,"/")>0 or instr(id,".")>0 then
'call closedb()
'call msg("错误的参数!")
typ=1
end if
if typ=0 then
sql="select filepath,downloadtimes from m3_uploadfiles where FileID='"&id&"'"
else
sql="select filepath,downloadtimes from m3_uploadfiles where filepath='"&id&"'"
end if
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
rs.close
set rs=nothing
call closedb()
call msg("该附不存在,可能被删除啦!!")
else
filepath=trim(rs("filepath"))
end if
rs.close
set rs=nothing
clicked=request.Cookies("matrix3_login")("clickedstr")
if len(clicked)>200 then
response.Cookies("matrix3_login")("clickedstr")=""
end if
if instr(clicked,id)=0 then
sql="update m3_uploadfiles set downloadtimes=downloadtimes+1 where FileID='"&id&"'"
conn.execute(sql)
response.Cookies("matrix3_login")("clickedstr")=clicked&id
end if
call closedb()
response.Redirect(filepath)
%>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -