日本国产亚洲-日本国产一区-日本国产一区二区三区-日本韩国欧美一区-日本韩国欧美在线-日本韩国欧美在线观看

當前位置:雨林木風下載站 > 技術開發教程 > 詳細頁面

不用組件完成上載技巧(1)

不用組件完成上載技巧(1)

更新時間:2022-05-13 文章作者:未知 信息來源:網絡 閱讀次數:

'---- 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
            UploadControl.Add "ContentType",ContentType
            
            'Get content of object
            PosBeg = PosEnd + 4
            PosEnd = InstrB(PosBeg,strRequestBin,boundary)-2
            Value = MidB(strRequestBin,PosBeg,PosEnd-PosBeg)
        Else
            'Get content of object
            Pos = InstrB(Pos,strRequestBin,getByteString(chr(13)))
            PosBeg = Pos + 4
            PosEnd = InstrB(PosBeg,strRequestBin,boundary)-2
            Value = getString(MidB(strRequestBin,PosBeg,PosEnd-PosBeg))
        End If

        'Add content to dictionary object
        UploadControl.Add "Value" , Value

        'Add dictionary object to main dictionary
        Set UploadRequest(Name) = UploadControl

        'Loop to next object
        BoundaryPos = InstrB(BoundaryPos+LenB(boundary),strRequestBin,boundary)
    Loop
End Function

'String to byte string conversion
Public Function getByteString(strString)
    Dim intCount

    getByteString = ""

    For intCount = 1 to Len(strString)
        getByteString = getByteString & chrB(AscB(Mid(strString,intCount,1)))
    Next
End Function

'Byte string to string conversion
Public Function getString(strString)
    Dim intCount

    getString = ""

    For intCount = 1 to LenB(strString)
        getString = getString & chr(AscB(MidB(strString,intCount,1)))
    Next
End Function
%>

溫馨提示:喜歡本站的話,請收藏一下本站!

本類教程下載

系統下載排行

主站蜘蛛池模板: 国产精品一区二区三区四区五区 | 国产基zz视频日本在线观看 | 亚洲国产精品一区二区第一页 | 亚洲免费中文 | 永久在线观看视频 | 私啪影院| 浮力影院5177yy草草影院 | 99视频精品全部免费免费观 | 成人日韩在线 | 日韩色| 亚洲三级一区 | 免费播放一区二区三区 | 看免费人成va视频全 | 伊人久久综合网亚洲 | 久青草久青草高清在线播放 | 亚洲欧美日韩国产中文 | 国产亚洲精品自在久久不卡 | 一区二区三区日韩免费播放 | 97综合| 免费吃奶摸下激烈视频网址免费 | 97视频在线观看免费视频 | 日本高清有码视频 | 国产在线观看精品一区二区三区91 | 午夜伦理在线 | 2021久久精品免费观看 | 欧美日韩在线网站 | 亚洲精品香蕉婷婷在线观看 | 国产福利在线观看精品 | 国产大片在线播放 | 中文字幕在线网 | 美女在线观看网站免费的 | 大美女久久久久久j久久 | 我爱干清风阁 | 在线观看成年人视频网站 | 国产亚洲欧美日韩v在线 | 亚洲狠狠婷婷综合久久久久 | 国产精品怡红院永久免费 | 91成人国产网站在线观看 | 成人永久免费视频 | 青青久在线视频免费观看 | 日韩 欧美 国产 亚洲 制服 |