The Request object restricts 102,399 bytes. So ....

Source: Internet
Author: User
Tags file upload html form variables
Request| object When you post a large form field, your may receive the following error message:

Error Type:
Request object, ASP 0107 (0x80004005)
The data being processed is over the allowed limit.

In Microsoft Internet information Server (IIS) 4.0, your may receive the following error message:
Request object error ' ASP 0107:80,004,005 '
Stack Overflow
/projectname/page.asp, Line XX
The data being processed is over the allowed limit.



Cause
The size limit of each form field this is retrieved in the Request object is 102,399 bytes. The error occurs when you are exceed this limit.



Resolution
To resolve this problem and use one of the following methods:

Instead of reading form variable values with the Request.Form collection, use Request.BinaryRead (request.totalbytes), and Parse the form values from the output of Request.BinaryRead.


Use a File Upload scheme, such as Microsoft Posting acceptor.


Break the HTML form variables into multiple form variables before you submit the form. The 102,399 byte limit is for each form variable, so can have multiple form variables of 102,399 characters or less. The following sample code illustrates this:
Warning:any with the "CODE provided in this ARTICLE" at YOUR OWN RISK. Microsoft provides this code ' as is ' without warranty of any kind, either express or implied, including but don't limited to The implied warranties of merchantability and/or fitness for a particular purpose.

<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.
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>
The Receiving Active Server page (ASP) page reconstructs the variable:
<%
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.