Maximum request length exceeded uploading files

Article:TECH14787  |  Created: 2006-07-19  |  Updated: 2009-07-23  |  Article URL
Article Type
Technical Solution


The following error was observed when trying to attach files in either the Helpdesk Worker or WinUser consoles that are larger than 4 MB:

Maximum request length exceeded.

Application_OnError - Unhandled Exception:
System.Web.HttpException: Maximum request length exceeded.
at System.Web.HttpRequest.GetEntireRawContent()
at System.Web.HttpRequest.GetMultipartContent()
at System.Web.HttpRequest.FillInFormCollection()
at System.Web.HttpRequest.get_Form()
at System.Web.UI.Page.GetCollectionBasedOnMethod()
at System.Web.UI.Page.DeterminePostBackMode()
at System.Web.UI.Page.ProcessRequestMain()

In addition, when using the Workflow "InputFileComponent", and then executing the resulting workflow process, and selecting a file that was larger than 4 MB, Internet Explorer displays a "Internet Explorer cannot display the webpage" message.


Helpdesk 6.x, Workflow 6.x and 7.x.  This will probably affect any solutions that have a file attachment option.


There is a 4MB attachment limit imposed by .NET.


To change the default post back size from 4 MB, you will need to modify the web.config file that the affected solution uses.

As an example, the following instructions will increase the default post back size to 8 MB for Helpdesk:

  1. From the Notification Server, open \Program Files\Altiris\Helpdesk\AeXHD\web.config with Microsoft Notepad
  2. Find the following lines of code:
        <globalization requestEncoding="utf-8" responseEncoding="utf-8" />
    and a few lines down:
  3. The following line of code should be added somewhere between the lines of code found in step 2:
       <httpRuntime maxRequestLength="8192"/>
  4. Your web.config file should now contain all three lines of code as seen below:
    <globalization requestEncoding="utf-8" responseEncoding="utf-8"/>
       (other lines of code)
    <httpRuntime maxRequestLength="8192"/>
  5. Save the file
  6. Restart IIS by opening a command prompt and typing "iisreset" (without the quotes)

An additional note about how machine.config files function in the Microsoft.NET Framework:

The Microsoft.NET Framework installation will have a machine.config file located in the path %windir%\\Framework\v1.1.432\Config\machine.config. Each additional Microsoft.NET application running on the server can have its own web.config file that overrides the settings found in the machine.config. It is a Microsoft Best Practice to edit the application specific web.config file instead of edting the main machine.config file. By making the changes recommended in this article, only the Helpdesk Server will use the 8 MB post back. The remaining Microsoft.NET applications on this server will continue to use the 4 MB settings that are found in the %windir%\\Framework\v1.1.432\Config\machine.config.

Other solutions will have their respective web.config files in specific locations.  However, Workflow solution provides an individual web.config for each project.  The above presented solution should be implemented in each case where you need a larger file post back size. All of the projects are configured by default under the  C:\Program Files\Altiris\Workflow Designer\WorkflowProjects folder.  Open the affected project folder and add or edit the respective web.config file to allow the appropriate size for files in your environment.

Legacy ID


Article URL

Terms of use for this information are found in Legal Notices