« Previous Next »

Thread: Changing maxAllowedContentLength

Last post 10-19-2009 2:54 PM by mbarga1. 7 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (8 items)

Sort Posts:

  • 01-22-2007, 5:22 PM

    Changing maxAllowedContentLength

    I'm using VS.NET 2005 running on Vista.

    The issue pertains to being able to upload large files in an ASP.NET application when using IIS 7.0 (and not when using the development webserver).

    My Web.config file for my application I have:

    maxRequestLength="2097151" (the maximum allowed).

    However when uploading large files (I've tried with a 60MB file) I get this error from IIS 7.0:

    _________________________________________________________________________________________

    HTTP Error 404.13 - Not Found

    Description: The request filtering module is configured to deny a request that exceeds the request content length.

    Error Code: 0x00000000

    Notification: BeginRequest

    Module: RequestFilteringModule

    What you can try:

    • Verify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting in the applicationhost.config or web.config file.

    More Information... This is a security feature. Do not change this feature unless the scope of the change is fully understood. You can configure the IIS 7.0 server to reject requests whose content length is greater than a specified value. If the request's content length is greater than the configured length, this error is returned. If the content length requires an increase, modify the configuration/system.webServer/security/requestFiltering/requestLimits@maxAllowedContentLength setting.

     _________________________________________________________________________________________

     

    I've never changed any setting in IIS 7.0 and so would appreciate it if someone can tell me how to change this setting.

    But more importantly, it seems that with IIS 7.0 we're now going to have to synchronize such settings in two places? Is that correct?

    Thanks in advance for any help.

    Shiv

  • 01-22-2007, 5:38 PM In reply to

    • thomad
    • Top 25 Contributor
    • Joined on 08-20-2002, 11:28 AM
    • Redmond
    • Posts 503

    Re: Changing maxAllowedContentLength

    Try this:

    %windir%\system32\inetsrv\appcmd set config -section:requestFiltering -requestLim
    its.maxAllowedContentLength:1000000

     or if you only want to set it for your app:

    %windir%\system32\inetsrv\appcmd set config "Default Web Site/<your app>" -section:requestFiltering -requestLimits.maxAllowedContentLength:1000000

     Hope this helps

    Thomas Deml
    Program Manager
    Internet Information Services
    Microsoft Corp.
  • 01-22-2007, 5:49 PM In reply to

    Re: Changing maxAllowedContentLength

    Thomas,

     

    Thank you for your quick reply! I'll try your suggestion...

     Is there a GUI that I can use to set this or config file local to my application that I can create in order to set this?

    Shiv.

  • 01-22-2007, 6:07 PM In reply to

    Re: Changing maxAllowedContentLength

    Thomas,

     I tried your suggestion and eventually got it working but have another question.

    What is the "unit of measure" for the maxAllowedContentLength attribute? In ASP.NET Web.config

    maxRequestLength is in KB. It looks like the maxAllowedContentLength is in bytes?

    Now in order to get your suggestion to work I had to modify the overrideModeDefault from "Deny" to "Allow" like so:

    <section name="requestFiltering" overrideModeDefault="Allow" />

    I'm assuming this change allows for "application level" control? If so, can I not add my setting to the web.config file of the application in question? 

    I had to "Allow

  • 01-22-2007, 6:13 PM In reply to

    Re: Changing maxAllowedContentLength

    Ok, I see that appCmd.exe modifies the applications web.config file with the required entries. Great, this is what I was looking for.

     

    Thank you for your help.

    Shiv.

  • 08-18-2008, 1:08 PM In reply to

    Re: Changing maxAllowedContentLength

    Also,

     With respect to this limit can anyone imagine a way to change the error returned from IIS from the very vague "HTTP Error 404.13 - Not Found" to something more relevant to the actual upload size error that actually occurs?

     

  • 04-02-2009, 8:08 AM In reply to

    Re: Changing maxAllowedContentLength

    Funny I just ran across this post and agree making the error more descriptive would help troubleshooting.

     

    Steve Schofield
    Windows Server MVP - IIS
    http://weblogs.asp.net/steveschofield


    http://www.IISLogs.com
    Log archival solution
    Install, Configure, Forget
  • 10-19-2009, 2:54 PM In reply to

    • mbarga1
    • Not Ranked
    • Joined on 10-19-2009, 6:50 PM
    • Posts 1

    Re: Changing maxAllowedContentLength

     I'm trying to load an app on a site for a server I just converted over from Windows 2003 to Windows 2008, I have tried changing this but I keep getting the same error.

    http://www.element-it.com/RequestFilteringModule-maxAllowedContentLength.aspx

     

    "The request filtering module is configured to deny a request that exceeds the request content length"

     

    The documentation from Microsoft says to change Applicationhost.config file but the file on my server doesn't even have the record which would make it work.  The Web.Config file is set correctly there is nothing to change but it still will not let me upload more then 30 megs.

     

    http://support.microsoft.com/default.aspx?scid=kb;EN-US;295626

     

    Any thoughts?

     

Page 1 of 1 (8 items)