看看什么原因,通过此asp上传的文件,收到的是二进制数,如何收到文件?

xiaolanlan 2002-02-04 02:40:37
<%
response.expires=0
idate=request.binaryread(request.totalbytes)
dim str1,str2,str3
dim st,st2,st3
for i=1 to len("filename")
str1=str1 & chrb(ascb(mid("filename",i,1)))
next
str2=str2 & chrb(ascb(chr(10))) & chrb(ascb(chr(13)))
st=instrb(1,idate,str1)
st2=instrb(st,idate,str2)
st2=st2+3
str3=str3 & chrb(ascb("-")) & chrb(ascb("-"))
st3=instrb(st2,idate,str3)
st3=st3-2

dim filepath,strpath
dim fi,fi2
fi=instrb(st,idate,chrb(ascb(chr(34))))
fi2=instrb(fi+1,idate,chrb(ascb(chr(34))))
filepath=midb(idate,fi+1,fi2-fi-1)
for i=1 to lenb(filepath)
sss=midb(filepath,i,1)
strpath=strpath & chrw(ascb(sss))
next
fi=instrrev(strpath,"\",-1,1)
strpath=right(strpath,len(strpath)-fi)
'response.write(strpath)

idate=midb(idate,st2,st3-st2)
'set f=createobject("myupload2.upload")
'f.spath="f:\" & strpath
'f.idate=idate
'f.uploadfile

'response.binarywrite(idate)
'set f=createobject("scripting.filesystemobject")
'set fc=f.createtextfile("f:\" & strpath,true)
'for i=1 to lenb(idate)
'fc.write chr(ascb(midb(idate,i,1)))
'next
'fc.close





'response.write(st & "<br>")
'response.write(st2 & "<br>")
'response.write(st3 & "<br>")
'response.write(str1 & "<br>")
'response.write(str2 & "<br>")
'response.write(str3 & "<br>")
'response.write(lenb(idate) & "<br>")
%>

该如何做上传呀?

...全文
66 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
julyclyde 2002-02-05
  • 打赏
  • 举报
回复
最新的也不支持
存binary可以用ADODB.STREAM对象
magicpower 2002-02-04
  • 打赏
  • 举报
回复
在现有的asp下的脚本只能对文本文件进行存盘 binary是肯定不行的
否则别人写的上传组件也就是瞎忙了
好象最新的asp版本支持直接上传
如果你无法注册组件 就只有存到数据库里面了
嘿嘿 我做过数据库的 很烦人
julyclyde 2002-02-04
  • 打赏
  • 举报
回复
收到的当然是binary,怎么会是文件呢!需要你自己存盘的

28,406

社区成员

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

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