图片上传路径保存在数据库里怎么做,请高手指教,谢谢!
图片可以上传到指定的文件夹了,但是路径不在数据库里,请问怎么弄才能使路径保存在数据库里。<!--#includefile="UpLoad_Class.asp"--><%d...
图片可以上传到指定的文件夹了,但是路径不在数据库里,请问怎么弄才能使路径保存在数据库里。
<!--#include file="UpLoad_Class.asp"-->
<%
dim upload,iserr,id,qid,desc,str
iserr = false
id = 0
qid = 0
desc = ""
set upload = new AnUpLoad
upload.Exe = "jpg|bmp|jpeg|gif|png"
upload.MaxSize = 1 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then
iserr = true
desc = upload.Description
else
dim file,savpath
savepath = "images"
set file = upload.files("file")
id = upload.forms("pid")
qid = upload.forms("que")
if not(file is nothing) then
result = file.saveToFile(savepath,0,true)
if result then
desc = file.filename
else
iserr = true
desc = file.Exception
end if
else
iserr = true
desc = "没有上传文件"
end if
end if
set upload = nothing
%>
<script type="text/javascript">
window.parent.setStep(<%=lcase(iserr)%>,'<%=replace(desc,"'","\'")%>');
</script>
请高手指点一下怎样改才能使图片的路径保存在img的字段里。谢谢! 展开
<!--#include file="UpLoad_Class.asp"-->
<%
dim upload,iserr,id,qid,desc,str
iserr = false
id = 0
qid = 0
desc = ""
set upload = new AnUpLoad
upload.Exe = "jpg|bmp|jpeg|gif|png"
upload.MaxSize = 1 * 1024 * 1024 '2M
upload.GetData()
if upload.ErrorID>0 then
iserr = true
desc = upload.Description
else
dim file,savpath
savepath = "images"
set file = upload.files("file")
id = upload.forms("pid")
qid = upload.forms("que")
if not(file is nothing) then
result = file.saveToFile(savepath,0,true)
if result then
desc = file.filename
else
iserr = true
desc = file.Exception
end if
else
iserr = true
desc = "没有上传文件"
end if
end if
set upload = nothing
%>
<script type="text/javascript">
window.parent.setStep(<%=lcase(iserr)%>,'<%=replace(desc,"'","\'")%>');
</script>
请高手指点一下怎样改才能使图片的路径保存在img的字段里。谢谢! 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询