Results 1 to 8 of 8

Thread: HTML: application/x-www-form-urlencoded

Hybrid View

  1. #1

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    HTML: application/x-www-form-urlencoded

    Is there a limit to the amount of data you can POST with
    application/x-www-form-urlencoded?
    I thought I hada problem with my CGI script because I couldn't POST more
    than 47kb as a string.
    But when I changed the server from IIS to Apache, the amount increased to
    69kb.

    This implied a built in limit of the server.

    Anyone know if this is configurable?

  2. #2
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: HTML: application/x-www-form-urlencoded

    Maximum post side is usually measured in MB not KB

    What is it you are trying to send?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  3. #3

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: HTML: application/x-www-form-urlencoded

    Im only sending a series of numbers added together in a string.

    To demonstrate what is happening download CVMichaels example CGI program
    http://www.vbforums.com/showthread.p...&highlight=cgi
    (bottom post in thread) and add a couple of lines to write the buffer to a log file e.g
    VB Code:
    1. Sub GetFormData()
    2.     Dim DataLen As Long, sData As String, lBytesRead As Long, rc As Long
    3.    
    4.     If UCase(Trim(Environ("REQUEST_METHOD"))) = "POST" Then
    5.         DataLen = Val(Environ("CONTENT_LENGTH"))
    6.  
    7.         If DataLen > 0 Then
    8.             sData = String(DataLen, 0)
    9.             rc = ReadFile(hStdIn, ByVal sData, DataLen, lBytesRead, ByVal 0&)
    10.             sData = Left$(sData, lBytesRead)
    11. [B]            Open "log.txt" For Append As #29
    12.                 Write #29, sData
    13.             Close #29[/B]
    14.         End If
    15.     End If
    16.    
    17.     PairData sData
    18.     PairData Environ("QUERY_STRING")
    19. End Sub

    Now paste 70kb of data into the form field and submit it.
    Depending on your server you wont necessarily have all the data in the log file.

    Note that it is a string not a file upload.
    This is because my application is an ActiveX control that collects lots of data from a measureing instrument and adds it all together as a string.
    The Onclick command of the (HTML) button then passes this string value to the (HTML) form and submits it.

  4. #4
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: HTML: application/x-www-form-urlencoded

    Are you actually encoding the data in the url encoded format?

    I.e: variable1=value1&variable2=value2

    If you do not require your data to be in this format, then set the enctype atttribute on the form to text/plain or if it is binary data: application/octet-stream.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  5. #5

    Thread Starter
    Frenzied Member agmorgan's Avatar
    Join Date
    Dec 2000
    Location
    Lurking
    Posts
    1,383

    Re: HTML: application/x-www-form-urlencoded

    The data is expected in the url encoded format, Ill have to check whether it actually does get encoded properly.
    Im not sure how that could have this effect though...

  6. #6
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: HTML: application/x-www-form-urlencoded

    Url encoded is designed to ctransport nam/value paris from form fields. Each input element in the form with the name is transferred along with its value in the form:

    firstname=Joe&surname=Bloggs&age=16

    Should the data contain any white space or the +/= character they are encoded using their ascii hexadecimal equivilent.

    http://www.w3schools.com/html/html_ref_urlencode.asp

    I am still not sure what you are doing. Are you using an HTML form to submit the data? If so then why don't you use a file upload?

    If you are using an Active X control client side, then I would by pass the HTML form and submit the data driectly to the CGI script. Pasting 70KB of data into a text box crashes Internet Explorer and takes Firefox an eternity to send.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

Posting Permissions

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



Click Here to Expand Forum to Full Width