473,395 Members | 1,535 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,395 software developers and data experts.

Fileupload Receives untrappable error when the file is too large

Apparently this problem has been plagueing programmers for about 10 years. Yet still Microsoft/IIS perhaps has not done anything about it. See this trail from 7 years ago: http://bytes.com/topic/asp-net/answe...error-handling Here 'Mike Moore' says 'that you cannot trap this error to handle it in a custom manner'.

What I have been able to do with a AsyncFileUpload control and the Global.asax is use the Application_Error section. But I can only trap it when I receive the 'Maximum request length exceeded' error. Then I can do a 'Request.Close' and go on with my business. However if I attempt to upload something really huge, say '400MB'. Then the IIS 7.5 server just sits there for a couple of seconds, and then it will give me an annoying popup - 'Server Response Error: Unknown Server Error' (almost like a Javascript alert), then I get a choice, Yes or Cancel. If I choose yes I get a second window with a 404 page. When debugging on the server the Global.asax is never hit.

Indeed in 2012, 7 years after Mike Moore's post, it appears this is still non-trappable and customizable???

Ideally I want to tell the user - "Hey, you picked a file that is way too huge!" Not have them look like they crashed our web-server.
Sep 19 '12 #1

✓ answered by robertkjr3d

I got it guys. On another site someone pointed out I was missing the maxAllowedContentLength limit in the web.config--> system.webServer section

Expand|Select|Wrap|Line Numbers
  1.  <security>
  2.             <requestFiltering>
  3.                 <requestLimits maxAllowedContentLength="4294967295"></requestLimits>
  4.             </requestFiltering>
  5.         </security>
  6.  
This allows asp.net to service the request if its underneath this size. The default request limit by iis7 is 28mb.

1 3552
I got it guys. On another site someone pointed out I was missing the maxAllowedContentLength limit in the web.config--> system.webServer section

Expand|Select|Wrap|Line Numbers
  1.  <security>
  2.             <requestFiltering>
  3.                 <requestLimits maxAllowedContentLength="4294967295"></requestLimits>
  4.             </requestFiltering>
  5.         </security>
  6.  
This allows asp.net to service the request if its underneath this size. The default request limit by iis7 is 28mb.
Sep 20 '12 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: Ajay Brar | last post by:
hi! I am getting an error - Crypto.PublicKey.RSA.error: Plaintext too large - when verifying the signature of a document. What i am doing is - the document and the signature are downloaded off...
6
by: Thomas Connolly | last post by:
I have 2 pages referencing the same codebehind file in my project. Originally the pages referenced separate code behind files. Once I changed the reference to the same file, everything worked...
5
by: BVM | last post by:
Hi: I have a problem when sending large email(more than 20Mb) from a web page. I got timeout error. How to overcome this problem? I am thinking to have a thread to send email. Once the thread...
0
by: vijay | last post by:
Hi, I have an ASP.NET application running on a multi-processor Windows 2003 server. The application has been behaving perfectly well for the last couple of months. Yesterday, we started...
5
by: reidarT | last post by:
Dim Kildefil as object Kildefil = "H:\dbBil\dbBil.mdb" if not Dir(Kildefil)) Then else Msgbox("Can't find file!",msgboxstyle.information,conMelding) end if I get this error when file is...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
0
by: Ant | last post by:
Hi, I have an error when trying to set a list box datasource to the same dataset twice. I understand why the error is occuring. What I don't understand is why, when enclosing this in a try...
1
by: colleen1980 | last post by:
This program runs fine in my company but when i try to run at home it gives that error: Compiler error: Procedure too large Thank You.
3
by: keithb | last post by:
Using a GridView, I get a "Specified cast is not valid" error when binding the Visible propery of a hyperlink control to a DataTable text field. The error goes away if I replace the data binding...
0
by: jcatubay | last post by:
I have a function that returns a list more than 200000 objects and the object has 37 fields. I added the wcf as a web reference so i dont have to add any configuration item in my web apps config...
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...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.