上传图片的问题!请教,谢谢!
页面显示代码
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<body>
<p align="center"><font size="6"><strong><font face="隶书">公司名</font></strong></font></p>
<p align="center"><font face="隶书"><strong><font size="6">上传图片</font></strong></font></p>
<form name="Poto" enctype="multipart/form-data" action="admin_sds_pic_confirm.asp" method=post>
<tr valign="top">
<td width="100%" height="55" align="center" valign="middle" bgcolor="#FF99CC"><div align="center">上传图片:
<input type="file" name="mefile">
<input type=submit name=ok value=" 上 传 ">
<font class="small" face="Arial" color="red" size="2"> </font></div></td>
</tr>
</form>
</body>
</html>
判断页代码
<%
if request.ClientCertificate("adminok") then
request.redirect"login.asp"
end if
%>
<!--#include file="set.asp"-->
<%id=request("id")%>
<%
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrb(13) & chrb(10)
divider=leftb(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf & bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
rst.open "select * from color_take where P_link is null",cnn,1,3
rst("p_link").appendchunk mydata
rst.update
rst.close
set rst=nothing
set conngraph=nothing
Response.Write("<script>alert('添加成功!');window.location=('admin_sds.asp')</script>")
%>
数据库中的字段为OLE对象就可以了!