Results 1 to 4 of 4
  1. #1
    Lounger
    Join Date
    Jan 2002
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    POST data format & ASP

    Hi

    I am trying to alter some code that involves a Form that POSTs its data and this is then read by a Request.BinaryRead. To change the code I need to understand the format of the data that POSTed. I appreciate that is in byte format. The program leaves it in that format and only converts the parts it needs. I need to find the successive locations off "name=" in the data. The program is in ASP VB script.

    Can any one tell ne where I can find what the general format of POSTed data is?

    For information hare is the code for the form
    <form enctype="multipart/form-data" name=formBuffer method=post action="<%=scriptName%>?precommand=ProcessUpload&f older=<%=server.URLEncode(Request.Form("folder"))% >&popup=true">
    <input type=file size=45 name=file class=formClass>
    <input type=file size=45 name=file class=formClass>
    <input type=file size=45 name=file class=formClass>
    <input type=file size=45 name=file class=formClass>
    </form>


    'Thanks

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: POST data format & ASP

    Four file uploads? This could be a lot of data.

    According to my old ASP 2.0 Nutshell, VBScript copes with Request.BinaryRead data by putting it into a Variant "SafeArray" of bytes. How can you search an array of bytes for a string? I really don't know the answer to that. However, you can concatenate the bytes into a string using a loop or, if VBScript works like VBA, you can do an implicit conversion by assigning the byte array to a string variable. (Maybe not, since VBScript doesn't have strong typing.)

    The concatenation would look like this:

    lngPostLength = Request.TotalByteCount
    varArray = Request.BinaryRead(lngPostLength)
    For varCounter = 1 to lngPostLength
    varLongString = varLongString & Chr(AscB(MidB(varArray, varCounter, 1)))
    Next

    (The above loop comes, more or less, from HOWTO: Handle Data from a Post Form When Hosting WebBrowser Control (Microsoft Knowledge Base Article - 256195)).

    Hope this helps.....

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: POST data format & ASP

    Actually, maybe what you should do is just use a loop like the above to blast it into the Response object (temporarily of course) and look at it that way?

  4. #4
    Lounger
    Join Date
    Jan 2002
    Posts
    40
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: POST data format & ASP

    Hi

    Thanks for both replies. I will try your ideas.

    Regards

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •