Beginning ASP.NET Web Pages with WebMatrix by Mike Brind & Imar Spaanjaars

Beginning ASP.NET Web Pages with WebMatrix by Mike Brind & Imar Spaanjaars

Author:Mike Brind & Imar Spaanjaars
Language: eng
Format: epub
Publisher: John Wiley & Sons, Inc.
Published: 2011-10-13T16:00:00+00:00


There will be times when you know that your visitors need to legitimately upload larger files. If this is the case, you can alter the default limit to any that you want by adding a web.config file to your site if you do not have one already, and adding a new configuration section within the system.web section:

<system.web> <compilation debug="true" targetFramework="4.0"/> <httpRuntime maxRequestLength="4096"/> </system.web>

The section is httpRuntime, which has a maxRequestLength attribute. The default value of the attribute is 4096KB, or 4MB. You can alter this to a more suitable value. For example, if you wanted to increase the total to 10MB, the new value you would apply to maxRequestLength would be 10240.

As of version 7, IIS also applies a validation check against HTTP request lengths, and will not even pass requests to ASP.NET to process if they exceed 26.8MB. So, by default, if the total size of the request exceeds this limit, the result is an error message from IIS (not ASP.NET).



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.