如何用XMLHTTP的方式提交数据(含有图片的)

dicklee1214 2003-08-21 06:03:28
我现在已经将一个字符串数据和一个图片数据存在node.attributes.getNamedItem("VARCHAR").nodeValue和node.attributes.getNamedItem("PHOTO").nodeValue中,通过XMLHTTP的方式提交到数据库的char1,photo1字段中,请问怎么写,给出例子更好,多谢各位!才接触XML,大家多帮忙
...全文
54 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
CRuntimeClass 2003-08-22
  • 打赏
  • 举报
回复
set XML_RS=Server.CreateObject("ADODB.Recordset")
set XML_DOC=Server.CreateObject("MSXML2.DOMDocument")
XML_DOC.load Request
XML_RS.open XML_DOC
set XML_DOC=nothing

set DB_CN=Server.CreateObject("ADODB.Connection")
set DB_RS=Server.CreateObject("ADODB.Recordset")
DB_CN.Open connstring
DB_RS.Open "SELECT char1,photo1 FROM tablename WHERE 1=0",DB_CN,2,3
DB_RS.AddNew
DB_RS("char1")=XML_RS("VARCHAR")
DB_RS("photo1").AppendChunk XML_RS("photo")
DB_RS.Update
DB_RS.Close
DB_CN.Close
set DB_RS=nothing
set DB_CN=nothing

XML_RS.Close
set XML_RS=nothing
CRuntimeClass 2003-08-22
  • 打赏
  • 举报
回复
set XML_RS=Server.CreateObject("ADODB.Recordset")
set XML_DOC=Server.CreateObject("MSXML2.DOMDocument")
XML_DOC.load Request
XML_RS.open XML_DOC
set XML_DOC=nothing

set DB_CN=Server.CreateObject("ADODB.Connection")
set DB_RS=Server.CreateObject("ADODB.Recordset")
DB_CN.Open connstring
DB_RS.Open "SELECT char1,photo1 FROM tablename WHERE 1=0",DB_CN,2,3
DB_RS.AddNew
DB_RS("char1")=XML_RS("char1")
DB_RS("photo1").AppendChunk XML_RS("photo1")
DB_RS.Update
DB_RS.Close
DB_CN.Close
set DB_RS=nothing
set DB_CN=nothing

XML_RS.Close
set XML_RS=nothing
saucer 2003-08-21
  • 打赏
  • 举报
回复
how did you encode the 图片数据?

>>>提交到数据库
if you are using ADODB, use AppendChunk, see

HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk
http://support.microsoft.com/default.aspx?kbid=194975

also see

http://www.15seconds.com/issue/010522.htm
saucer 2003-08-21
  • 打赏
  • 举报
回复
how did you encode the 图片数据?

>>>提交到数据库
if you are using ADODB, use AppendChunk, see

HOWTO: Read and Write BLOBs Using GetChunk and AppendChunk
http://support.microsoft.com/default.aspx?kbid=194975

also see

http://www.15seconds.com/issue/010522.htm

8,906

社区成员

发帖
与我相关
我的任务
社区描述
XML/XSL相关问题讨论专区
社区管理员
  • XML/XSL社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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