-
Feb 10th, 2005, 10:55 AM
#1
Thread Starter
Frenzied Member
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?
-
Feb 11th, 2005, 06:24 AM
#2
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?
-
Feb 11th, 2005, 07:52 AM
#3
Thread Starter
Frenzied Member
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:
Sub GetFormData()
Dim DataLen As Long, sData As String, lBytesRead As Long, rc As Long
If UCase(Trim(Environ("REQUEST_METHOD"))) = "POST" Then
DataLen = Val(Environ("CONTENT_LENGTH"))
If DataLen > 0 Then
sData = String(DataLen, 0)
rc = ReadFile(hStdIn, ByVal sData, DataLen, lBytesRead, ByVal 0&)
sData = Left$(sData, lBytesRead)
[B] Open "log.txt" For Append As #29
Write #29, sData
Close #29[/B]
End If
End If
PairData sData
PairData Environ("QUERY_STRING")
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.
-
Feb 11th, 2005, 08:41 AM
#4
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.
-
Feb 11th, 2005, 09:57 AM
#5
Thread Starter
Frenzied Member
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...
-
Feb 11th, 2005, 11:37 AM
#6
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|