一个ASP无组件上传的问题----存不到数据库里
现在上传的文件已经传到我想要保存的文件夹里面去了,但是数据库是空白的没有保存文件的路径。我估计是在保存的时候没有得到他的路径。我的程序是这样写的<!--#includef...
现在上传的文件已经传到我想要保存的文件夹里面去了,但是数据库是空白的没有保存文件的路径。我估计是在保存的时候没有得到他的路径。我的程序是这样写的
<!--#include file="conn.asp"-->
<!--#include file="UpLoad_Class.asp"-->
<%
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.froms("file1")
response.Write file
if not(file is nothing) then
set result = file.saveToFile(savepath,1,false)
Set up = server.CreateObject("adodb.recordset")
sql = "select * from [F_rt]"
up.Open sql, conn, 1, 3
up.addnew
up("file1") = file1
up.update
up.Close
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
%>
麻烦各位帮看一下,谢谢。。。。。 展开
<!--#include file="conn.asp"-->
<!--#include file="UpLoad_Class.asp"-->
<%
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.froms("file1")
response.Write file
if not(file is nothing) then
set result = file.saveToFile(savepath,1,false)
Set up = server.CreateObject("adodb.recordset")
sql = "select * from [F_rt]"
up.Open sql, conn, 1, 3
up.addnew
up("file1") = file1
up.update
up.Close
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
%>
麻烦各位帮看一下,谢谢。。。。。 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询