最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
不用组件实现上载功能(英文NT)
时间:2022-11-14 23:39:11 编辑:袖梨 来源:一聚教程网
'---- file name /upaoad.asp/
<%
Public Function BuildUploadRequest(strRequestBin)
Dim PosBeg, PosEnd, boundary, boundaryPos
'Get the boundary
PosBeg = 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))
boundary = MidB(strRequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,strRequestBin,boundary)
'Get all data inside the boundaries
Do until (boundaryPos = InstrB(strRequestBin,boundary & getByteString("--")))
'Members variable of objects are put in a dictionary object
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary")
Dim Pos, Name
'Get an object name
Pos = InstrB(boundaryPos,strRequestBin,getByteString("Content-Disposition"))
Pos = InstrB(Pos,strRequestBin,getByteString("name="))
PosBeg = Pos + Len("name=") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))
Name = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
Dim PosFile, PosBound, ContentType, Value
'Test if object is of file type
PosFile = InstrB(BoundaryPos,strRequestBin,getByteString("filename="))
PosBound = InstrB(PosEnd,strRequestBin,boundary)
If PosFile <> 0 AND PosFile < PosBound Then
'Get FilePathName of the file
PosBeg = PosFile + Len("filename=") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))
FilePathName = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
'Add filename(with path) to dictionary object
UploadControl.Add "FilePathName", FilePathName
'Get Content-Type of the file
Pos = InstrB(PosEnd,strRequestBin,getByteString("Content-Type:"))
PosBeg = Pos + Len("Content-Type:") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))
ContentType = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
'Add content-type to dictionary object
<%
Public Function BuildUploadRequest(strRequestBin)
Dim PosBeg, PosEnd, boundary, boundaryPos
'Get the boundary
PosBeg = 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))
boundary = MidB(strRequestBin,PosBeg,PosEnd-PosBeg)
boundaryPos = InstrB(1,strRequestBin,boundary)
'Get all data inside the boundaries
Do until (boundaryPos = InstrB(strRequestBin,boundary & getByteString("--")))
'Members variable of objects are put in a dictionary object
Dim UploadControl
Set UploadControl = CreateObject("Scripting.Dictionary")
Dim Pos, Name
'Get an object name
Pos = InstrB(boundaryPos,strRequestBin,getByteString("Content-Disposition"))
Pos = InstrB(Pos,strRequestBin,getByteString("name="))
PosBeg = Pos + Len("name=") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))
Name = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
Dim PosFile, PosBound, ContentType, Value
'Test if object is of file type
PosFile = InstrB(BoundaryPos,strRequestBin,getByteString("filename="))
PosBound = InstrB(PosEnd,strRequestBin,boundary)
If PosFile <> 0 AND PosFile < PosBound Then
'Get FilePathName of the file
PosBeg = PosFile + Len("filename=") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(34)))
FilePathName = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
'Add filename(with path) to dictionary object
UploadControl.Add "FilePathName", FilePathName
'Get Content-Type of the file
Pos = InstrB(PosEnd,strRequestBin,getByteString("Content-Type:"))
PosBeg = Pos + Len("Content-Type:") + 1
PosEnd = InstrB(PosBeg,strRequestBin,getByteString(chr(13)))
ContentType = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
'Add content-type to dictionary object
相关文章
- 王者荣耀侦探能力大测试攻略 王者荣耀侦探能力大测试怎么过 11-22
- 无期迷途主线前瞻兑换码是什么 11-22
- 原神欧洛伦怎么培养 11-22
- 炉石传说网易云音乐联动怎么玩 11-22
- 永劫无间手游确幸转盘怎么样 11-22
- 无期迷途主线前瞻兑换码是什么 无期迷途主线前瞻直播兑换码介绍 11-22