图片上传到sql数据库出错了!~

qing7911 2005-12-20 10:35:03
FormSize = Request.TotalBytes '得到数据
FormData = Request.BinaryRead( FormSize )
Request 对象 错误 'ASP 0104 : 80004005'
不允许操作

上一页代码:
<form name="form1" ENCTYPE="multipart/form-data" ACTION="upimage.asp" METHOD="POST">
<input NAME="picture" TYPE="FILE">
<input type="submit" name="Submit" value="提交">
</form>
...全文
114 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
qing7911 2005-12-26
  • 打赏
  • 举报
回复
还是不行,有那位大虾有完整一点的代码让我下载呀?qing-7911@163.com
zhanghongwen 2005-12-21
  • 打赏
  • 举报
回复
set iRe=Server.CreateObject("ADODB.Recordset")
iConcStr = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False" & _
";Data Source=" & server.mappath("../gs.asp")
iSql="select * from digital where id="& session("id") &""

iRe.Open iSql,iConcStr,1,3
iLen=Request.TotalBytes
sBin=Request.BinaryRead(iLen)
iCrlf1 = ChrB(13) & ChrB(10)
iCrlf2 = iCrlf1 & iCrlf1
iLen = InStrB(1, sBin, iCrlf1) - 1
iSpc = LeftB(sBin, iLen)
sBin = MidB(sBin, iLen + 34)
iPos1 = InStrB(sBin, iCrlf2) - 1
While iPos1 > 0
iStr = f_Bin2Str(LeftB(sBin, iPos1))
iPos1 = iPos1 + 5
iPos2 = InStrB(iPos1, sBin, iSpc)

iPos3 = InStr(iStr, "; filename=""") + 12
If iPos3 > 12 Then
iStr = Mid(iStr, iPos3)
iPos3 = InStr(iStr, Chr(13) & Chr(10) & "Content-Type: ") - 2
iFn = Left(iStr, iPos3)
If iFn <> "" Then

iRe("fname") = mid(iFn,instrrev(iFn,"\")+1)
iRe("img_type") = Mid(iStr, iPos3 + 18)
iRe("img").AppendChunk MidB(sBin, iPos1, iPos2 - iPos1)
iRe.Update
End If
End If

sBin = MidB(sBin, iPos2 + iLen + 34)
iPos1 = InStrB(sBin, iCrlf2) - 1
Wend
response.Redirect("digital_data_1.asp")
response.end

iRe.close
set iRe=Nothing
  • 打赏
  • 举报
回复
你是不是binary之后又request了?

28,406

社区成员

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

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