Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Maximum total size limit for post variables 2

Status
Not open for further replies.

Maccaday

Technical User
Dec 9, 2003
71
GB
Hi,

Can anyone tell me what the size limit for an individual POST variable is, please?

Is there a total size limit for the sum of all the POST environmental variables sent with a request?

Is there a limit on the total number of variables sent with a POST request?

I need to send large amounts of information with each request, that can't be stored on the server side.

Thanks.
 
Guru7777,

Thanks for the reply. I had also found this page when searching for the answer myself. It seems to suggest that there is a limit for POST variables, though it's not clear whether it is a limit for individual variables, or a total limit. Also, one of the links given says that there isn't a limit for POST variables, though this also is vague as to whether it is for individual variables or the total.

I'll keep on looking though.

Cheers.
 
Quoted from the article:

There used to be a limit on the length of GET requests. Now it's
technically "unlimited" by spec, but individual servers are allowed to
impose a limit no lower than the old limit.

Ditto for POST, only POST was a higher old limit.

Still can't rely on the Browser, intermediary servers, and your server
to all transmit anything over the old limit (4K?) for POST.


It states that POST and GET are unlimited now. But, that a server could limit it to no less than the old limit which they, and I, believe to be 4k. Also notice at the top of the page that this was written in 2000. Most people have probably since gotten with the unlimited program. I know for a fact that I have "POSTed" many, many kilobites of data to an ASP page for insertion in to a database.
 
Thanks again.

I didn't miss what it said. However, I have read about 8 articles now, and they all seem to give different answers. I haven't found two articles that say the same thing. Some quote maximum values for an individual variable, and others quote total maximums (as this article appears to do), and others no limits at all. Although the theoretical limit is unlimited, I am trying to assertain what current practical limits are.

I did notice the date as well, and suspected that the limits would probably be higher now - another reason why I am looking for up-to-date information. Some more recent articles quote higher limits as well, but they all seem to say 'I think it's so-and-so'.

If you are successfully posting large amounts of data, then that is the most useful piece of information to me. What is the largest amount that you have successfully posted? I will be conducting my own tests, but I'd like to know that it's not just my setup that is working properly. I'd probably be looking at trying to send up to about 50KB (absolute maximum), with a typical amount of about 10KB. Have you been successful with this amount of data? Have you sent data all in one or two variables, or have you split them up into many variables?

Thanks again for your responses.
 
I created a simple JSP page with a textarea that lets you submit (to the same page). The page has a button that lets you count the number of characters in the textarea.

Using this simple harness I submitted 50k of data in one textarea successfully. I was using Tomcat4.1X and Apache2 against IE6 (all running on Windows).

I then did the same thing for a PHP page and repeated the task with the same result.

I don't have an ASP installation handy to compare against, but I think you can assume that 50k is not going to be a problem.

Here are the files if you are interested in testing this yourself:

test.jsp
Code:
<%@ page language="java"%>
<%
String theData = request.getParameter("myData") == null ? "" : request.getParameter("myData");
%>
<html>
<head><title>Data Example</title>
<script type="text/javascript">
</script>
</head>
<body>
<form name="myForm" method="post" action="">
<textarea name="myData" rows="10" cols="40"><%=theData%></textarea>
<br />
<input type="button" value="Count characters" onclick="alert(document.myForm.myData.value.length)"/>
&nbsp;&nbsp;
<input type="submit" value="Test this data" />
</form>
</body>
</html>

test.php
Code:
<html>
<head><title>Data Example</title>
<script type="text/javascript">
</script>
</head>
<body>
<form name="myForm" method="post" action="">
<textarea name="myData" rows="10" cols="40"><? echo $_POST['myData'] ?></textarea>
<br />
<input type="button" value="Count characters" onclick="alert(document.myForm.myData.value.length)"/>
&nbsp;&nbsp;
<input type="submit" value="Test this data" />
</form>
</body>
</html>



Jeff
 
Thanks - That's what I was hoping.

I have one final query. I shall be storing all my variables in javascript variables, then when submitted, they will be sent as form variables. I haven't tried it yet, but I am assuming that this would be easy enough to do by writing the javascript variable to a hidden variable (or series thereof) before posting (which would probably need to be posted by ajavascript-scripted button rather than a submit button, since the writing of the variables would need to be done first).

Do you know of any problems in doing it this way? Since you can submit text, I am assuming that (unlike cookies) there are no problems with spaces and other text characters.

Thanks again for your responses.
 
That's good stuff BabyJeffy -- a STAR for you!

I also have passed at least 50 kb of information through the Post method. I'm thinking that the max I have sent over is between 75-80 kb.
 
I would suggest you have some hidden fields in your form, and populate them with your javascript variabale data just before you do the actual submit... then you won't have to worry about any of the encoding or special characters etc.

Jeff
 
Thanks,

That's what I'd thought about doing.

Cheers for all your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top