这页中横线所夹范围内的代码为什么这样写?POST及GET方法提交数据的格式是什么?
MeXP 2001-10-29 04:53:53 图片提交页photoinput.asp:
<form enctype="multipart/form-data" method="POST"
action="photo_save.asp">
<div align="center"><center><table border="0" cellpadding="0" cellspacing="0" width="55%">
<tr>
<td width="100%" height="30">选择图片(*.jpg格式):</td>
</tr>
<tr>
<td width="100%" height="30"><input type="file" name="filename" size="40"></td>
</tr>
<tr>
<td width="100%" align="right" height="30"><input type="submit" value="Submit"></td>
</tr>
</table>
</center></div>
</form>
存储到数据库中photo_save.asp:
response.buffer = true
action = request.querystring("action")
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 rec = server.createobject("adodb.recordset")
rec.open "photo_news",conn,1,3
conn.begintrans
rec.addnew
rec("photo").appendchunk mydata
rec.update
这页中横线所夹范围内的代码为什么这样写?POST及GET方法提交数据的格式是什么?