请问,ASP中,如何向SQL添加图片??谢谢各位高手了!请举例!

shirw 2003-09-12 11:54:08
请问,ASP中,如何向SQL添加图片??谢谢各位高手了!请举例!
...全文
49 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
不老书生 2003-09-12
  • 打赏
  • 举报
回复
对,用lyfupload.dll,里面有直接上传到数据库的方法!
billyqiao 2003-09-12
  • 打赏
  • 举报
回复
使用lyfupload.dll
bubuy 2003-09-12
  • 打赏
  • 举报
回复
存入图片:
<script language="vbscript" runat="server">
dim st,xmldoc,iPic
dim temp
temp="c:\pic\example.jpg"
set st = Server.CreateObject("adodb.stream")
st.Type=1
st.Open
st.loadFromFile temp
dim rs
set rs = Server.CreateObject("adodb.recordset")
rs.open "youdb",yourconn,3,2
rs.addnew
rs("img").appendChunk st.read(-1)
rs.update
rs.close
</script>
读取图片:
<img src="image.asp?id=1" border="0">

image.asp
<%
response.ContentType="image/*"
set rs = yourDBConn.execute("select img from yourDB where id="&request("id"))
Response.BinaryWrite rs("img")
%>
csdnxw 2003-09-12
  • 打赏
  • 举报
回复
又很多这种控件,你去搜索一下吧
这个问题网上到处都是

28,390

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧