日期:2014-05-17  浏览次数:20919 次

关于图片上传的数据处理
各位大虾,有个问题请教一下.
是关于图片上传的问题.
本人使用在网上看到上传方法(把图片放进数据库)

(UPLOAD文件)
.......
<form   method= "post "   action= "Img_deal.asp "   name= "form1 "   id= "form1 ">
<input   type= "text "   name= "bianhao "/>
<select   name= "type ">
<option   value= "婚纱 "> 婚纱 </option>
<option   value= "晚装 "> 晚装 </option>
</select>
<input   name= "productImage "   type= "file "   id= "productImage "   style= "width:185 "/>

<input   type= "button "   name= "Submit "   value= "上传资料 "   onClick= "amendImage(); "   />
<input   type= "button "   name= "Submit2 "   value= "返回 "   onClick= "parent.history.back();   return   false; "   />
.....

----------------------
图片处理文件Img_deal.asp

<%
'将图片保存到数据库中
imgsize=request.TotalBytes
imgData=request.BinaryRead(imgsize)
Hcrlf=chrB(13)&chrB(10)
Divider=leftB(imgdata,clng(instrB(imgData,Hcrlf))-1)
dstart=instrB(imgData,chrB(13)&chrB(10)&chrB(13)&chrB(10))+4
Dend=instrB(dstart+1,imgdata,divider)-dstart
Mydata=MidB(imgdata,dstart,dend)
set   rs=server.CreateObject( "adodb.recordset ")
sql= "select   *   from   tb_Img   where   id   is   null "
rs.open   sql,conn,1,3
on   error   resume   next
rs.addnew
rs( "Img ").appendchunk   mydata
rs.update
rs.close
set   rs=nothing
if   err=0   then
%>
<script   language= "javascript ">
alert( "文件上传成功! ");
window.location.href= "index.asp ";
</script>
<%
else
%>
<script   language= "javascript ">
alert( "文件上传失败! ");
window.location.href= "Img.asp ";
</script>
<%
end   if
%>
----------------------------------------------------

请问要如何在Img_deal.asp中,处理其余表单中的数据

------解决方案--------------------
那就用无组件上传了,无惧上传类
http://www.softhy.net/soft/6595.htm