Post more than 100K of data in the form field

Source: Internet
Author: User
Tags file upload
When a form sends a large amount of data, an error occurs. Check out MSDN to learn that the reason is that Microsoft has a limit on the maximum data that can be received with Request.Form (), 80K bytes in IIS4, and 100K bytes in IIS5.
Here are some of the solutions offered by Microsoft:
1, using Request.BinaryRead instead of Request.Form method to analyze form data;
2, the use of File upload scheme, such as: Microsoft Posting acceptor;
3. Because the 102399-byte limit is for each form element, it is submitted by separating the form element content greater than 102399 into multiple table cells.
Here is the sample code: (Microsoft Reminder: The following code does not necessarily fully apply to specific needs, not the consequences of using these code is responsible!) )
<form method=post action=largepost.asp name=theform onsubmit= "Breakitup ()" >
<textarea rows=3 cols=100 name=bigtextarea>a Bunch of text...</textarea>
<input Type=submit value=go>
</form>
<script language=javascript>
function Breakitup ()
{
Set the limit for field size.
If the content has Chinese characters, it can be set to: 51100
var formlimit = 102399
Get the value of the large input object.
var TempVar = new String
TempVar = Document.theForm.BigTextArea.value
If the length of the object is greater than the limit, break it
into multiple objects.
if (Tempvar.length > Formlimit)
{
Document.theForm.BigTextArea.value = tempvar.substr (0, Formlimit)
TempVar = Tempvar.substr (formlimit)
while (Tempvar.length > 0)
{
var Objtextarea = document.createelement ("TEXTAREA")
Objtextarea.name = "Bigtextarea"
Objtextarea.value = tempvar.substr (0, Formlimit)
Document.theForm.appendChild (Objtextarea)
TempVar = Tempvar.substr (formlimit)
}
}
}
</SCRIPT>

Accept data page main code:
<%
Dim Bigtextarea
For I = 1 to Request.Form ("Bigtextarea"). Count
Bigtextarea = Bigtextarea & Request.Form ("Bigtextarea") (I)
Next
%>


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.