⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 upload.asp

📁 日记本(多用户版)V3.0 主要功能: 1、日记本基本功能:添加、修改日记等。 2、日记加密:当日记添加时
💻 ASP
字号:
<%
If Session("admindiary")="" then
   Response.write "无法上传图片,请用管理员身份登陆日记本后台再上传。"
   Response.end
End If
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 2px;
	margin-top: 2px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;

}
.textbox {
	font-size: 9pt;
	color: #006600;
	width: 98%;
	height: 210px;
	line-height: 18pt;
	border: 1pt solid #009900;
	clear: none;
	float: none;
}
td {
	font-size: 9pt;
	color: #003300;
}
.inttext {
	font-size: 9pt;
	color: #006600;
	border: 1px solid #006600;
}
-->
</style></head>
<!--#include file="inc.asp" -->
<!--#include file="upload.inc" -->
<%
dim action
action=request("action")
if action="up" then
call uploadstart
else
call dd
end if
sub uploadstart
dim ss
mfkiqpl.openmdb
set rs=conn.execute("select id,n4 from setos where id=1")
ss=rs("n4")
mfkiqpl.closers(rs)
mfkiqpl.closeconn
set upload=new upload_5xsoft
set file=upload.file("textfield")
IDstring="logo"&date & time
IDstring=Replace(IDstring,"-","")
IDstring=Replace(IDstring,":","")
pthString="UpfileLogo/"
FileTpe=Mid(file.filename,Len(file.filename)-2)
filepath=pthString & IDstring & "." & FileTpe
filepath=replace(filepath,"../","")
if file.filesize>0 then
if file.filesize>ss then
set file=nothing
response.write("<script>alert('现规定上传Logo大小不能大于"&ss&"字节(B)!\r\r有需要请与网站管理员联系以重设上传大小!');history.back(1);</script>")
else
FileTpe=Mid(file.filename,Len(file.filename)-2)
if not (ucase(fileTpe)="JPG" or ucase(fileTpe)="GIF") then
response.write("<script>alert('上传文件的格式只能为:JPG、GIF。');history.back(1);</script>")
else
file.saveAs Server.mappath(pthString & IDstring & "." & FileTpe)
set file=nothing
response.write("<script>top.form1.textfield3.value='"&filepath&"'</script>")
end if
end if
end if
response.write ("<a style=""font-size: 9pt;color: #006600;"">  上传成功!请继续填写其它信息!</a>")
response.write "<script>parent.document.form1.WebLogo.value='" & filepath & "'</script>"
end sub
%>
<body>
<%sub dd%>
<form action="?action=up" method="post" enctype="multipart/form-data" name="form1">
 <input name="textfield" type="file" class="inttext"> 
<input name="buttion" type="submit" class="inttext" value="上传">
</form>
<%end sub%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -