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

📄 letsgo.asp

📁 blog 又搭工
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!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 type="text/css">
<!--
#Layer1 {
	position:absolute;
	left:26px;
	top:51px;
	width:409px;
	height:178px;
	z-index:1;
}
.STYLE1 {
	font-size: 24px;
	font-weight: bold;
	color: #FF0000;
	font-family: "黑体";
}
a:link {
	color: #FF0000;
	text-decoration: none;
}
a:visited {
	color: #FF0000;
	text-decoration: none;
}
a:hover {
	color: #0066FF;
	text-decoration: underline;	
}
a:active {
	color: #FF0000;
	text-decoration: none;
}
-->
</style>
</head>
<body style="font-size:12px;">
<p>
  <%
	function btos(data)
		dim strnow,strtemp,flag,i
			for i=1 to lenb(data)
				if flag=true then
					flag=false
				else
					strnow=midb(data,i,1)
					if ascb(strnow)>127 then
						strtemp=strtemp&chr(ascw(midb(data,i+1,i)&strnow))
						flag=true
					else
						strtemp=strtemp&chr(ascb(strnow))
					end if
				end if
			next	
		btos=strtemp
	end function
%>
  <%

	
	
	dim formdata,formsize
		formsize=request.totalbytes
		formdata=request.binaryread(formsize)
			'response.binarywrite formdata
		'response.write "看哇,全是乱码!"
		dim bncrlf,divider
		bncrlf=chrB(13)&chrb(10)
		divider=leftb(formdata,cint(instrb(formdata,bncrlf)))
			'response.write "<br /><br /><br />分隔符"
			'response.binarywrite "<br />"& divider&"<br />"
	dim datastart,dataend,datalen
		datastart=instrb(formdata,bncrlf)+57
			'response.write "datastart=" &datastart&"<br />"
		dataend=instrb(datastart,formdata,bncrlf)-2
			'response.write "dataend="&dataend&"<br />"
		datalen=dataend-datastart+1
			'response.write "datalen="&datalen&"<br />"
		filepath=midb(formdata,datastart,datalen)
		
			'response.write "路径为:"
		'	response.binarywrite filepath
		'mime类型
		temp=dataend
		datastart=temp+18
		dataend=instrb(datastart,formdata,bncrlf&bncrlf)-1
		datalen=dataend-datastart+1
		contentType=midb(formdata,datastart,datalen)
		contentType=btos(contentType)
			'response.write "<br/><br/>MIME类型:"
			'response.binarywrite contentType
		temp=dataend
		datastart=dataend+5	
		dataend=instrb(datastart,formdata,divider)-3
		datalen=dataend-datastart+1
		fileimage=midb(formdata,datastart,datalen)
		'fileimage=btos(fileimage)
			'response.write "<br/><br/>文件内容:"
			'response.binarywrite fileimage
		filesize=lenb(fileimage)
		If filesize Mod 2 = 1 Then
			fileimage=fileimage & Chrb(32)
		End If		
		dim rs,strsql
		set rs=server.createobject("adodb.recordset")
		strsql="select * from tupian"
		'db.execute(strsql)
		rs.open strsql,db,1,3
			rs.addnew 
			rs("image").AppendChunk fileimage 					
		rs.update
		session("imageid")=rs("id")
		response.Write "成功上传&nbsp;&nbsp;<a href='add_img.asp'>继续添加</a>&nbsp;&nbsp;<a href='img.asp'>查看</a>"
		response.write "请复制这段下去放在[IMG]与[/IMG]之间就行了。<font color='red'>admin/show.asp?id="&session("imageid")&"</font>"
		%>
		<%set rs=nothing
		set db=nothing
	
%>
</p>

</body>
</html>

⌨️ 快捷键说明

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