473,382 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

Maximum request length exceeded.

I'm experimenting with an upload file page.
I have a few HtmlInputFile on it.

While testing it, I selected a 12MBfile, click "upload".
I was think I am safe as (at last in the code) I don't upload file bigger
than 1MB.

At the top of my request there is a module where I access the request and
while querying a parameter:
string var = context.Request["param"]

I get the following exception:
===
System.Web.HttpException was unhandled by user code
Message="Maximum request length exceeded."
Source="System.Web"
ErrorCode=-2147467259
StackTrace:
at System.Web.HttpRequest.GetEntireRawContent()
at System.Web.HttpRequest.GetMultipartContent()
at System.Web.HttpRequest.FillInFormCollection()
at System.Web.HttpRequest.get_Form()
at System.Web.HttpRequest.get_Item(String key)
at LangModule.HTranslate(Object sender, EventArgs e) in
f:\MyWork\eCookBook\WebSite\asp.net\App_Code\LangM odule.cs:line 36
at
System.Web.HttpApplication.SyncEventExecutionStep. System.Web.HttpApplication.IExecutionStep.Execute( )
at System.Web.HttpApplication.ExecuteStep(IExecutionS tep step,
Boolean& completedSynchronously)
===

What could I do to get around that?
I mean, I don't want to download 12MB file (I just skip the upload and write
a error status message) and I don't want them to cause my application to
fail....

Perhaps some Javascript?

--
I have taken a vow of poverty. If you want to really piss me off, send me
money.
Jan 19 '06 #1
2 9469
The default maximumRequestLength is 4 mb. While ASP.NET can handle much
larger files, MS recommends a 10-20 mb limit for the files.

If you're using ASP.NET 1.1, try sticking this in your web config file
(16mb limit) somewhere inside of <system.web>

<httpRuntime maxRequestLength="16384" />

See:
http://msdn.microsoft.com/library/de...imesection.asp

In ASP.NET 2.0, you can set this dynamically at the page level.

See:
http://msdn2.microsoft.com/en-us/lib...estlength.aspx

Jan 19 '06 #2
Thanks for the links Mark!

"Mark S. Milley, MCAD (BinarySwitch)" <ma*********@binaryswitch.com> wrote
in message news:11**********************@z14g2000cwz.googlegr oups.com...
The default maximumRequestLength is 4 mb. While ASP.NET can handle much
larger files, MS recommends a 10-20 mb limit for the files.

If you're using ASP.NET 1.1, try sticking this in your web config file
(16mb limit) somewhere inside of <system.web>

<httpRuntime maxRequestLength="16384" />

See:
http://msdn.microsoft.com/library/de...imesection.asp

In ASP.NET 2.0, you can set this dynamically at the page level.

See:
http://msdn2.microsoft.com/en-us/lib...estlength.aspx

Jan 19 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Jacky Kwok | last post by:
Dear all: I know how to use the "Application_Error" in "Global.asax" to catch the exception and display my own error message page. However, I found "Application_Error" cannot handle the error...
2
by: cmay | last post by:
I have changed my config files to set the limit for files being uploaded to 30 MB, but every now and then someone tries to upload a file larger than this. All I want, is to be able to trap the...
11
by: Chris Hayes | last post by:
Greetings, I have an ASP.NET page that accepts input from an HtmlInputFile object. I have set the maximum size for HttpRequests to 2MB in the web.config file. And now I am trying to CATCH...
0
by: Chris Hayes | last post by:
I've seen that when an HTTP 400 error occurs ("Maximum request length exceeded") that some of my Session level variables and Cookies get "lost" is there a way to preserve them without resorting to...
3
by: J055 | last post by:
Hi How do I tell the user he has tried to upload a file which is too big... 1. when the httpRuntime.maxRequestLength has been exceeded and 2. when the uploaded file is under then...
3
by: =?Utf-8?B?UGV0ZXIgU2NobWl0eg==?= | last post by:
HI, in one of my webservices I need to provide a string to the consuming application that can become really large (depending on user input). Unfortunately, if the string becomes too long, the...
11
by: =?Utf-8?B?VmxhZCBIcnlib2s=?= | last post by:
Using IIS7, Vista x64, ASP.NET 2.0. I am getting HTTP 400 "Bad Request" for the following URL:...
1
by: Cactus77 | last post by:
Hi, I have a problem with deploying a Report Model. I've build a Report Model in Visual Studio and by deploying mij my model, I get the next error: ...
1
by: =?Utf-8?B?Q2h1Y2sgUA==?= | last post by:
I have an HttpModule used for Unhandled Exception processing. The module monitors both application.Error += new EventHandler(OnError); //regular UHE AppDomain.CurrentDomain.UnhandledException +=...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.