📄 index.asp
字号:
<!--#include file="mdb.asp"-->
<%
dim id:id=request.querystring("del")
if id<>"" then
dim fso:set fso=server.createobject("scripting.filesystemobject")
dim f:set f=server.createobject("adodb.recordset")
f.open "select * from files where id="&id,conn,1,1
if f.recordcount>0 then
dim path:path=server.mappath(f("fileurl"))
if fso.fileExists(path) then fso.deletefile(path)
conn.execute "delete * from files where id="&id
end if
f.close
set f=nothing
end if
if err then response.write "<font color=red>发生错误:"&err.description&"</font><br />"
%>
<html>
<head>
<style>
table {FONT-SIZE: 12px;}
body {FONT-SIZE: 12px;}
input {border:1px #dddddd solid;padding-top:3px}
textarea {border:1px #dddddd solid}
</style>
<script language="javascript" src="inc/js.js"></script>
<title>AnUpload无组件上传1.0</title>
</head>
<body style="font-size:12px">
<form style="padding:10px;border:1px solid #eeeeee;width:500px" name=upload method="post" onsubmit="return check();" action="doupload.asp" enctype="multipart/form-data">
标题 <input type=text name=title style="width:370px;"><br>
说明 <textarea name=info cols=50 rows=5></textarea><br>
本地上传 <input type=file name=file1 style="width:370px;"><br><br>
<input type="submit" value="上传" style="margin-left:200px;"><br></form>
<hr width=500 align=left />
<%
set rs=server.createobject("adodb.recordset")
sql="select * from files"
rs.open sql,conn,1,1
if rs.recordcount>0 then
do while not rs.eof
response.write "标题:"&rs("title")&" 路径:"&rs("FileUrl")&" <a href="""&rs("FileUrl")&""" title="""&rs("title")&""">下载</a> <a href=""?del="&rs("ID")&""">删除</a><br />"
rs.movenext
loop
else
response.write "没有任何上传记录!"
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -