论坛新增功能的求助
想实现如下图的方式,在有人发言的时候,只要选好图片,写好留言,然后点击确定,图片和留言均被写到数据库中去,,有没有办法啊?
<form name="mainForm" enctype="multipart/form-data" action="process.asp" method=post>
<textarea name="content"></textarea>
<input type=file name=mefile><br>
<input type=submit name=ok value="提交">
</form>
-------------------------process.asp--------------------
<%
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)
set connGraph=server.CreateObject("ADODB.connection")
connGraph.ConnectionString="Driver={sql server};server=192.168.39.40;database=bbs;uid=sa;pwd=ljlcym;"
connGraph.Open
set rec=server.createobject("ADODB.recordset")
rec.Open "SELECT * FROM [images] where id is null",connGraph,1,3
rec.addnew
rec("content")=request("content")
rec("img").appendchunk mydata
rec.update
rec.close
set rec=nothing
set connGraph=nothing
%>
报错:
不能使用一般 Request 收集
/test/process.asp,行32
调用 BinaryRead 后不能使用一般 Request 收集。