艾恩ASP无组件上传保存到数据库出错
dimuploadsetupload=newAnUpLoadupload.Exe="doc|docx"upload.MaxSize=5*1024*1024'5Muploa...
dim upload
set upload = new AnUpLoad
upload.Exe = "doc|docx"
upload.MaxSize = 5 * 1024 * 1024 '5M
upload.openProcesser= true
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
response.Write("<script language=javascript>alert('上传错误,请检查您的文件类型!');history.go(-1)</script>")
else
dim file,savpath
savepath = "../upfile/Resume"
set file = upload.files("file1")
if not(file is nothing) then
set result = file.saveToFile(savepath,1,false)
'--------------------------------------------------------
'start
Set up = server.CreateObject("adodb.recordset")
sql = "select * from [F_rt]"
up.Open sql, conn, 1, 3
up.addnew
up("file1") = file.saveToFile("file1") '错误行
up.update
up.Close
'end
'-------------------------------------------------------
if not result.error then
'response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
response.Write "<script language=javascript>alert('上传成功!');window.location.href='onlion_re.asp';</script>"
else
response.Write file.Exception
end if
end if
end if
set upload = nothing
现在报错信息为:
Microsoft VBScript 运行时错误 (0x800A01C2)
错误的参数个数或无效的参数属性值: 'SaveToFile'
/rt/web/upload.asp, 第 27 行
麻烦各位大侠帮看看,谢谢...... 展开
set upload = new AnUpLoad
upload.Exe = "doc|docx"
upload.MaxSize = 5 * 1024 * 1024 '5M
upload.openProcesser= true
upload.GetData()
if upload.ErrorID>0 then
response.Write upload.Description
response.Write("<script language=javascript>alert('上传错误,请检查您的文件类型!');history.go(-1)</script>")
else
dim file,savpath
savepath = "../upfile/Resume"
set file = upload.files("file1")
if not(file is nothing) then
set result = file.saveToFile(savepath,1,false)
'--------------------------------------------------------
'start
Set up = server.CreateObject("adodb.recordset")
sql = "select * from [F_rt]"
up.Open sql, conn, 1, 3
up.addnew
up("file1") = file.saveToFile("file1") '错误行
up.update
up.Close
'end
'-------------------------------------------------------
if not result.error then
'response.Write "文件'" & file.LocalName & "'上传成功,保存位置'" & server.MapPath(savepath & "/" & file.filename) & "',文件大小" & file.size & "字节"
response.Write "<script language=javascript>alert('上传成功!');window.location.href='onlion_re.asp';</script>"
else
response.Write file.Exception
end if
end if
end if
set upload = nothing
现在报错信息为:
Microsoft VBScript 运行时错误 (0x800A01C2)
错误的参数个数或无效的参数属性值: 'SaveToFile'
/rt/web/upload.asp, 第 27 行
麻烦各位大侠帮看看,谢谢...... 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询