我这里图片上传后怎么才能让图片的路径自动保存到数据库??
来源:互联网 发布:淘宝客服绩效考核表格 编辑:程序博客网 时间:2024/04/29 21:58
各位高手,麻烦看看我这代码要改那里才能让图片的地址自动保存在我的数据库中?
这个无惧上传页面upfile_flash.asp
我这个<%@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>
这个无惧上传页面upfile_flash.asp
<!--#include file="upload_wj.inc"-->
<%
set upload=new upload_file
if upload.form("act")="uploadfile" then
formpath="up_pic/"
FileExt=trim(upload.form("FileExt"))
i=0
for each formName in upload.File
set file=upload.File(formName)
fileExt=lcase(file.FileExt)'得到的文件扩展名不含有.
if file.filesize<100 then
response.write "<script language=javascript>alert('请先选择你要上传的文件!');history.go(-1);</script>"
response.end
end if
if FileExt<>"swf" and FileExt<>"jpg" and fileext<>"gif" then
response.write "<script language=javascript>alert('该文件类型不能上传!');history.go(-1);</script>"
response.end
end if
if FileExt="swf" then
if fileext<>"swf" then
response.write "<script language=javascript>alert('只能上传swf格式的Flash文件!');history.go(-1);</script>"
response.end
end if
end if
if FileExt="jpg" then
if FileExt<>"gif" and fileext<>"jpg" then
response.write "<script language=javascript>alert('只能上传jpg或gif格式的图片!');history.go(-1);</script>"
response.end
end if
end if
if FileExt="swf" then
if file.filesize>(3000*1024) then
response.write "<script language=javascript>alert('Flash文件大小不能超过3m!');history.go(-1);</script>"
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
session("bb")=filename%>
<form id="form1" name="form1" method="post" action="save.asp">
<table width="373" border="1">
<tr>
<td width="92">图片地址</td>
<td width="265">图片名称</td>
</tr>
<tr>
<td><input name="url" type="text" id="url" value="<% response.write FileName%>" /></td>
</tr>
</table>
<input type="submit" name="Submit" value="提交" />
</form>
<%
if file.FileSize>0 then ''如果 FileSize > 0 说明有文件数据
'file.SaveAs Server.mappath(filename) ''保存文件
file.SaveToFile Server.mappath(FileName)
session("aa")=FileName
if filelx="swf" then
response.write "<script>window.opener.document."&upload.form("FormName")&".size.value='"&int(file.FileSize/1024)&" K'</script>"
end if
response.write "<script>window.opener.document."&upload.form("FormName")&"."&upload.form("EditName")&".value='"&FileName&"'</script>"
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>
0 0
- 我这里图片上传后怎么才能让图片的路径自动保存到数据库??
- php上传图片到指定位置路径保存到数据库
- js前端预览上传图片到七牛服务器,保存图片路径到数据库的方法
- Asp.net 上传图片,保存路径到数据库
- Django如何让上传的图片保存到自己想要的路径
- php上传图片到指定位置路径保存到数据库的具体实现
- asp.net简单的上传图片保存相对路径到数据库!
- 上传图片把缩略图保存到指定的虚拟路径
- 拉伸图片的时候怎么才能让图片不变形
- asp怎么把图片上传到指定的文件夹,然后在数据库中记录图片的路径
- 把图片上传保存到数据库
- 上传图片保存到MySql数据库
- 上传图片并保存到数据库
- php 上传图片保存到数据库例子
- spring上传图片并保存到数据库
- php 上传图片保存到数据库例子
- php 上传图片保存到数据库例子
- php上传图片的代码并保存到数据库
- android新手,一个破功能搞了一天
- android调用java的webservices返回结果null
- android studio 连接 asp.net ashx
- Android开发在代码中控制view的显隐时,界面滚动条滚动
- setting中switchpreference问题
- 我这里图片上传后怎么才能让图片的路径自动保存到数据库??
- 用httpclient发动请求到服务器的问题
- asp 读取 json 列表
- Android eclipse project->clean后原本能运行的app出错了
- 学习android系统
- IOS 分类-如何使用原类中对实例变量
- okhttp中Chain代表什么
- 安卓转ios需要哪些基础知识
- Jason数据解析求解?