Forum Moderators: open

Message Too Old, No Replies

IE is not sending large query fields on POST

         

shabeepk

9:29 pm on May 10, 2004 (gmt 0)



I am using java servlets ... its even making problem when i post data using internet explorer ... it does not post complete data in the textarea ... but only send near about 1000 characters or around something like that ... can anyone tell me what the problem can be? can it be solved using any other data encoding scheme ... like i use text/html can there be any solution regarding this thing?

tedster

10:03 pm on May 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hello shabeepk, and welcome to the forum.

We had a related discussion last fall. See this post:

[webmasterworld.com...]

Nothing 100% definitive there, but perhaps some ideas to get you thinking. At any rate, if you are using POST, then IE itself should not be imposing limits on the amount of data in a textarea.

Hester

8:18 am on May 11, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This problem has plagued me for ages. We never had a problem when using an Apache server, but as soon as we moved to an IIS (Windows) one, IE6 would refuse to submit text from a form over a certain number of characters. I tried everything to solve it, but couldn't.
I checked the PHP configuration so it matched the server before. Other browsers had no problems - just IE6.

To solve this one means we can set up new programs that have had to be abandoned. Basically it means no submit forms can be used on our site! I'm just trying to solve this right now using Javascript and cookies, but if anyone can help shed some light on this problem, do let me know!

kniceguy2know

7:36 pm on May 12, 2004 (gmt 0)

10+ Year Member



I had a similar problem with a form that I had used in a PHP based page. After an incredible amount of hair pulling and Microsoft cursing (Mozilla seemed to send more data than IE), I discovered that I had not explicitly specified the form method as POST. I guess that browsers tend to use GET by default, which has a much smaller size limit. I have little idea about servlets but there could be a similarity here.

john_k

8:48 pm on May 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



When a form is submitted with a GET method, the form data is included in the request line as if it were a querystring. The request line is the first line of a request and comes before the headers.

Here is an example of what is actually sent to the server when a form is submitted with the GET method. There are two form fields with names "a" and "b":


GET /Test.asp?a=12&b=yes+I+am HTTP/1.1
Host: www.example.com
Connection: close

When a form is submitted with a POST method, the form data is sent as the message/body entity after the headers.

Here is an example of the same form data being submitted with the POST method:


POST /Test.asp HTTP/1.1
Host: www.example.com
Content-Length: 15
Content-Type: application/x-www-form-urlencoded
Connection: close

a=12&b=yes+I+am

I have seen others write that there is a size limit to a query string. I couldn't find that in the HTTP 1.1 RFC (RFC 2616), but it does elude to it by stating that a server status code of 414 might be returned by a server if the URI is longer than the server wants to process.

Anyway, I expect that your data is indeed being sent via GET instead of POST and that the IIS server is truncating the query string portion of the request line in an attempt to prevent buffer overflow attacks.

Hester

8:47 am on May 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I solved it yesterday via a workaround. But first, here's what I was doing before. I had set up a simple HTML form leading to a second page that displayed the contents of the textarea. I had tried GET but found the maximum number of characters was 1,708. If you entered 1,709, the browser didn't even do anything.

Using POST it was even worse. The maximum characters (in IE6) was between 235 and 332, depending on things like the cache. Any more and it would just stick, the loading bar continuously moving along the bottom of the browser window.

Other browsers had no problems, whether GET or POST was used (though GET still has the limit of 1,708 characters, at least on my system.)

So what I did was make a form that stored the text from a textarea into a cookie, using JavaScript. I figured I could then retrieve the text using PHP and process it from there. (I need to then save it onto the server, hence the need for PHP.) After much trial and error, it worked!

But here's what I found. My form was using POST and worked fine offline. But when I uploaded it, the form would give me an error: "The page cannot be found". Huh?! Then I realised it was not a 404 error but a 405! That is, a "Resource not allowed" error. Digging into the Microsoft IIS online error help pages, I learnt that the method used to access my second page was not allowed - so it had to be the form. So I changed it from POST to GET and it worked fine!

It suggests there is an error with the IIS server which other browsers ignore, but causes POST not to work with IE6. Is this possible?

Now here's the crunch. Remember I said there was a 1,708 character limit with GET? Not any more! By storing the text in a cookie, I now have a text limit of around 4000 characters! This is because a cookie can store up to 4Kb of data. (Though that also includes the name and date.) Magic!

john_k

2:37 pm on May 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



POST should normally accomodate an unlimited data size. That's really what it's there for. So either POST has been disallowed or there is something screwed up on the IIS server.

The POST method can be disabled for the entire server, a single website, or just a folder. (maybe even for a single file) This is normally done via the IIS Control Panel. POST can also be disabled via the URLScan utility. The settings for this are in a .ini file.