<!--#include file="upload_5xsoft.inc"-->
<!--#include file="conn.asp"-->
<%set rs = server.createobject("adodb.recordset")
sql = "select top 1 * From pro order by pid desc"
rs.open sql,conn,1,3
pid = rs("pid") + 1 %>
<%
response.Charset="utf-8"
session.CodePage=65001
set upload=new upload_5xsoft
pnumber=upload.form("pnumber")
pfmc=upload.form("pfmc")
ptypename=upload.form("ptypename")
ppic=upload.form("ppic")
prid=upload.form("prid")
color=upload.form("color")
fulname=upload.form("fulname")
photo=upload.form("photo")
photo1=upload.form("photo1")
photo2=upload.form("photo2")
photo3=upload.form("photo3")
products=upload.form("products")
compatible=upload.form("compatible")
applicable1=upload.form("applicable1")
applicable2=upload.form("applicable2")
applicable3=upload.form("applicable3")
accessory=upload.form("accessory")
pfunction=upload.form("pfunction")
set ars=server.CreateObject("adodb.recordset")
sql="select top 1 * from pro"
ars.open sql,conn,3,2
ars.addnew
ars("pnumber")=pnumber
ars("pfmc")=pfmc
ars("ptypename")=ptypename
ars("ppic")=ppic
ars("color")=color
ars("fulname")=fulname
ars("photo")=photo
ars("products")=products
ars("compatible")=compatible
ars("pfunction")=pfunction
ars("prid")=prid
num=upload.form("total")
ars.update
ars.close()
'set ars=nothing
set ars=nothing
for n=1 to num
set file=upload.file("file"&n)
if file.fileSize>0 then
Fname=file.FileName
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from [image] order by id desc"
rs.open sql,conn,3,2
rs.addnew
rs("pid")=pid
rs("url")="d"&rs("pid")&Fname
rs.update
sid=rs("pid")
rs.close()
set rs=nothing
file.saveAs Server.mappath("image/d"&sid&Fname)
end if
set file=nothing
next
set upload=nothing
conn.close()
set conn=nothing
'for i=11 to 20
' set file=upload.file("file"&i)
' if file.fileSize>0 then
' Fname=file.FileName
' set rs=server.createobject("adodb.recordset")
' sql="select top 1 * from [image1]"
' rs.open sql,conn,3,2
' rs.addnew
' rs("pid")=pid
' rs("url")="d"&rs("pid")&Fname
' response.Write(pid)
' rs.update
' sid=rs("pid")
' rs.close()
' set rs=nothing
' file.saveAs Server.mappath("image/d"&sid&Fname)
' end if
' set file=nothing
'next
'set upload=nothing
'conn.close()
'set conn=nothing
%>
<%response.Write (pid) %>;
<%response.Write (num) %>;
<%response.Write (prid)%>;
<%response.write (Fname)%>;作者: 梦的放肆 时间: 2010-1-7 02:52
for each formName in upload.File
获取表单文件域的值作者: 優雅dē颓废 时间: 2010-1-7 02:52
有人看到吗?作者: 兮哩糊涂の斗 时间: 2010-1-7 02:52
其中image表中相关字段为id pid url 三个
其他字段都在PRO表中,有pid prid等,image中的pid对应pro表中的pid作者: 灬☆爱你 时间: 2010-1-7 02:52
不行啊,upload.file用在这出错,无效
Microsoft VBScript 运行时错误 (0x800A01C2)
错误的参数个数或无效的参数属性值: 'upload.File'
/17/gxxt/product/adddetailupdate.asp, 第 52 行