📄 upload1.asp
字号:
<%
OPTION EXPLICIT
Server.ScriptTimeOut=999999
%>
<!-- #include virtual="/inc/conn.asp" -->
<!--#include virtual = "/CheckLogin.asp" -->
<!--#include virtual="/upload/upfile_class.asp"-->
<%
'On error resume next
dim objUp, Rs, strPath, fso
dim strTitle, strFileName, strTeachingSujectID
Dim strResult
strPath = "/uploadfile/Photo/"
set objUp = new UpFile_Class
objUp.AllowExt = "jpg;gif;png;bmp"
objUp.GetData(1024*500)
Select Case objUp.isErr
Case 0
objUp.savetofile "strFile", Server.mappath(strPath)& "\" & Session("Tno") & "." & objUp.file("strFile").fileExt
Set Rs = Server.CreateObject("ADODB.Recordset")
RS.Open "select * From Teacher where id=" & session("ID"), conn, 2, 3
RS("Pic") = Session("Tno") & ".jpg"
RS.Update
RS.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
strResult = "上传图片成功"
case 1
strResult = "没有数据上传"
case 2
strResult = "文件大小超出"
case 3
strResult = "只允许传图片类型"
End select
Set fso = Nothing
set objUp = nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>网络教学平台</title>
<style>
body
{
width:100%;
height: 100%;
font-size: 12px;
background-color: #B1DB99;
}
#Content
{
}
#Content p a
{
color: #006;
text-decoration: none;
}
</style>
<script language="javascript">
window.onload = function(){
alert("<%=strResult%>");
location.href = "/DetailTeacher.asp?ID=<%=Session("id")%>";
}
</script>
</head>
<body>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -