如何向数据库中存储图象

powerhappy 2002-03-28 11:06:33
我做了一个程序需要向sql server中存储图象文件要怎么实现
...全文
27 14 打赏 收藏 转发到动态 举报
写回复
用AI写文章
14 条回复
切换为时间正序
请发表友善的回复…
发表回复
powerhappy 2002-04-07
  • 打赏
  • 举报
回复
谢了先
powerhappy 2002-04-07
  • 打赏
  • 举报
回复
多谢了:qiushuiwuhen(秋水无恨)
applehoo 2002-04-07
  • 打赏
  • 举报
回复
无组件上传图片到服务器不就行了,不用必须存到数据库吧。。。
8988 2002-04-06
  • 打赏
  • 举报
回复
现成的代码,要不要,拿去修改一下,就可以用了。想要的话,短信中告诉你的eamil,我给你发过来。
qiushuiwuhen 2002-03-31
  • 打赏
  • 举报
回复
rs("content").appendchunk content

用appentChunk方法,切记content是image(sql server)
powerhappy 2002-03-31
  • 打赏
  • 举报
回复
能不能再详细一点。
我有一个这样的程序
<form method = "post" action = "SaveImage.asp">
<input type = "file" name = "edtFileDir">
</form>

edtFileDir为在硬盘上的图片路径
在SaveImage.asp中应该如何写
powerhappy 2002-03-30
  • 打赏
  • 举报
回复
请问你是怎么将图片放入content中的
powerhappy 2002-03-30
  • 打赏
  • 举报
回复
我试试先
qiushuiwuhen 2002-03-29
  • 打赏
  • 举报
回复

sqlserver中字段设置为image
<%
FormSize=Request.TotalBytes
if FormSize>0 then
FormData=Request.BinaryRead(FormSize)
bnCRLF=chrB(13) & chrb(10)
Divider=LEFTB(FormData,INSTRB(FormData,bnCRLF)-1)
DataStart=INSTRB(FormData,bnCRLF & bnCRLF)+4
DataEnd=INSTRB(DataStart+1,FormData,Divider)-DataStart
content=MIDB(FormData,DataStart,DataEnd)
sql="select * from file"

set conn=server.createobject("adodb.connection")
conn.open 数据库连接字符串
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,2,3

if rs.eof then rs.addnew
rs("content").appendchunk content
rs.update

rs.close
set rs=nothing
conn.close
set conn=nothing

response.write "<a href=RESULT.ASP>上传结果</a>"
end if
%>
<form enctype="multipart/form-data" action=upload.asp method=post>
<input name=picture type=file accept="image/gif"><input type=submit value="上传图片">
</form>

ps:ado中stream是操作二进制文件的
北极海hein 2002-03-29
  • 打赏
  • 举报
回复
VBScript
用ado中的strame对象吧,具体点样用,查查MSDN吧,那里有详细例子
powerhappy 2002-03-28
  • 打赏
  • 举报
回复
能不能具体一些
xz_king 2002-03-28
  • 打赏
  • 举报
回复
关注
0_0 2002-03-28
  • 打赏
  • 举报
回复
用Response.BinaryWrite
希偌 2002-03-28
  • 打赏
  • 举报
回复
http://www.csdn.net/expert/topic/529/529306.xml?temp=.6462671

87,996

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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