不使用组件上传图形文件(100分)

  • 主题发起人 主题发起人 sgh
  • 开始时间 开始时间
S

sgh

Unregistered / Unconfirmed
GUEST, unregistred user!
不使用组件上传图形文件,在ASP 中的不支持MIDBP,LEFTB函数怎么办。
 
Use Form's File Button. It can upload any file...
If you want to narrow the file type, you can check the detail in RFC.
The request going to Servlet will be multi-content, you have better find a freeware to handle it, or you have to analyze the content.
Check: www.servlets.com there are some examples.
 
近期结束
 
假设img字段为二进制字段
response.buffer=true
formsize=request.totalbytes
formdata=request.binaryread(formsize)
bncrlf=chrB(13) &
chrB(10)
divider=leftB(formdata,clng(instrb(formdata,bncrlf))-1)
datastart=instrb(formdata,bncrlf &
bncrlf)+4
dataend=instrb(datastart+1,formdata,divider)-datastart
mydata=midb(formdata,datastart,dataend)
set rec=server.createobject("ADODB.recordset")
rec.Open conn,1,3
rec.New
rec("img").appendchunk mydata
rec.update
rec.close
set rec=nothing
 
多人接受答案了。
 
后退
顶部