bugnet icon indicating copy to clipboard operation
bugnet copied to clipboard

Application error after trying to 'Save & Return' when attachment is too large

Open asudman opened this issue 10 years ago • 7 comments

When creating a new issue, if the attachment is too large and the user clicks 'Save & Return', BugNet does not save the issue and returns "Application Error - /Issues/CreateIssue/1". If the user selects 'Save', the issue is created but the attachment is not included (no error or warning about the size of attachement).

asudman avatar Apr 29 '15 17:04 asudman

as a follow up, here's the detailed error log

Maximum request length exceeded. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Maximum request length exceeded.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[HttpException (0x80004005): Maximum request length exceeded.] System.Web.HttpRequest.GetEntireRawContent() +12703549 System.Web.HttpRequest.GetMultipartContent() +221 System.Web.HttpRequest.FillInFormCollection() +357 System.Web.HttpRequest.EnsureForm() +110 System.Web.HttpRequest.get_HasForm() +12705935 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +146 System.Web.UI.Page.DeterminePostBackMode() +129 System.Web.UI.<ProcessRequestMainAsync>d__14.MoveNext() +1304

asudman avatar Apr 29 '15 20:04 asudman

You can fix this by changing the max request length value in the web.config to accept larger file uploads

<system.web>
 <httpRuntime maxRequestLength="X" />
</system.web>

The maxRequestLength is measured in kilobytes.

dubeaud avatar Apr 30 '15 16:04 dubeaud

We don't want to change the max attachment size. Besides, the error will happen again whenever anyone attaches something larger than the new max size.

asudman avatar Apr 30 '15 16:04 asudman

This is true, and why we show the error page if this happens.

dubeaud avatar Apr 30 '15 16:04 dubeaud

I would think the error would be handled a bit better and have a message appear on the screen similar to when a required field is left empty, as opposed to having the application crash with no message saying that the attachment is too large...it just displays "Application Error - /Issues/CreateIssue/1"...nothing that says the attachment is too large. Also, if you click the 'Save' button instead of the 'Save & Return' button, there it no error at all. The issue is created but the attachement is not saved. Again, no message letting the user know the attachment is too large, but at least it doesn't abort the application :-/

asudman avatar Apr 30 '15 16:04 asudman

ASP.NET doesn't provide a nice way to handle this error. There are hacks but nothing really solid that I have seen.

dubeaud avatar Apr 30 '15 16:04 dubeaud

at the least couldn't the issue be created and the application crash avoided, as when the 'Save' button is clicked?

asudman avatar Apr 30 '15 16:04 asudman