?? letsgo.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 "成功上傳 <a href='add_img.asp'>繼續添加</a> <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 + -