📄 upfile2.asp
字号:
dds
<!-- #include file=../database.asp -->
<!-- #include file=../change.asp -->
<!-- #include file=upload.inc -->
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from ourusers where username='supervisor'"
rs.open sql,conn,1,1
if not rs.eof then
if trim(rs("pass"))<>trim(session("pass")) then
response.write "<br>错误的密码!"
'rs.close
'set rs=nothing%>
<script>top.location='../login.asp';</script>
<%
'response.write "rspass:"&rs("pass")
'response.write "sesseionpass:"&session("pass")
conn.close
set conn=nothing
response.end
else
rs.close
set rs=nothing
conn.close
set con=nothing
end if
else
response.write "错误:用户不存在!"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
%>
<html>
<head>
<link rel="stylesheet" type="text/css" href="../html/style.CSS">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor=ccbbaa>
<%
function lngConvert2(strTemp)
str1=leftb(strTemp,1)
str2=rightb(strTemp,1)
lngConvert2 = clng(ascb(str2) + ((ascb(str1) * 256)))
end function
function lngConvert(strTemp)
str1=leftb(strTemp,1)
str2=rightb(strTemp,1)
len1=ascb(str1)
len2=ascb(str2)
lngConvert = clng(ascb(str1) + ascb(str2) * 256)
end function
Dim FormData,FormSize
FormSize=Request.TotalBytes
FormData=Request.BinaryRead(FormSize)
response.write "大小"&FormSize&"<br>"
if FormSize>64535 then
response.write "文件太大,不能上传!<br>"
response.end
end if
Set Fields = GetUpload(FormData)
If Fields("photo").FileName="" Then
response.write "没选择要上传的文件!"
Response.end
end if
Set fs = CreateObject("Scripting.FileSystemObject")
dim tempstr
tempstr=server.mapPath(dirstring&"manage/")
response.write tempstr&"\test.htm"
Set outfile=fs.CreateTextFile(tempstr&"\test.htm",true)
Fields("photo").Value=bin2str(Fields("photo").Value)
'response.write Fields("photo").Value
outfile.Write Fields("photo").Value
outfile.close
set outfile=nothing
set fs=nothing
%>
上传成功!!<a href=geturl.asp>马上提取网址</a>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -