?? editupfile.asp
字號(hào):
<!--#include file="conn.asp"-->
<!--#include FILE="upload_5xsoft.asp"-->
<%
if session("adminname")="" then
response.redirect "relogin.asp"
end if
dim upload,file,formName,formPath,iCount,newname
set upload=new upload_5xSoft ''建立上傳對(duì)象
flag=upload.form("flag")
tmid=upload.form("tmid")
readno=upload.form("readno")
%>
<html>
<head>
<title>文件上傳</title>
<link rel="stylesheet" type="text/css" href="css.css">
</head>
<body>
<center>
<form method="POST">
<%
formPath= "examimage/"
for each formName in upload.file ''列出所有上傳了的文件
set file=upload.file(formName) ''生成一個(gè)文件對(duì)象
if file.FileSize>0 then ''如果 FileSize > 0 說明有文件數(shù)據(jù)
newname=year(date)&month(date)&day(date)&hour(time)&minute(time)&second(time)&file.FileName
file.SaveAs Server.mappath(formPath&newname) ''保存文件
end if
next
set file=nothing
set upload=nothing ''刪除此對(duì)象
if flag=1 then
sql1="select * from tbread where tmid="&tmid&" and readno="&readno
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,3,2
rs1("pic")=newname
rs1.update
response.redirect "admindatabaseeditread.asp?tmid="&tmid&"&readno="&readno
else
sql1="select * from tbtk where tmid="&tmid&" "
set rs1=server.createobject("adodb.recordset")
rs1.open sql1,conn,3,2
rs1("photo")=newname
rs1.update
response.redirect "admindatabaseedit.asp?tmid="&tmid
end if
%></center></form> </body></html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -