我这里图片上传后怎么才能让图片的路径自动保存到数据库??
各位高手,麻烦看看我这代码要改那里才能让图片的地址自动保存在我的数据库中?
这个无惧上传页面upfile_flash.asp
session("aa")=FileName%>
<%
end if
set file=nothing
next
set upload=nothing
end if
%>
我这个<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>保存图片</title>
</head>
我这个[color=#99CC00]save.asp页面怎么才能融合到上面的upfile_flash.asp页面完成自动保存功能????[/color]<!--#include file="conn.asp"-->
<%set rs=server.createobject("adodb.recordset")
rs.open "select * from url" ,conn,1,3
rs.addnew
rs("url")=request("url")
rs.update
%>
<img src="<% response.write request("url")%>"></img>
<script language="javascript">
window.alert("文件上传成功!");
window.close();
</script>
<body>
</body>
</html>
response.end
end if
end if
if FileExt="jpg" then
if file.filesize>(1000*1024) then
response.write "<script language=javascript>alert('图片文件大小不能超过1m!');history.go(-1);</script>"
response.end
end if
end if
randomize
ranNum=int(90000*rnd)+10000
filename=formPath&year(now)&month(now)&day(now)&hour(now)&minute(now)&second(now)&ranNum&"."&fileExt
if file.FileSize>0 then
file.SaveToFile Server.mappath(FileName)
rs.addnew '''''''''''''''
rs("url")=filename''''''''''''
rs.update''''''''''''
end if
set file=nothing
next
set upload=nothing
end if
%>
<img src="<% response.write filename%>"/>
<script language="javascript">
window.alert("文件上传成功!");
window.close();
</script>
