[Reprint] windows 7 IIS 7.5 ASP. Net file upload size limit, 7.5asp.net
Source:
Author: Yun Zhongyue
Link: http://www.cnblogs.com/netlover/archive/2011/07/08/Win7_IIS_Upload.html
IS 7 the default file upload size IS 30 mb
To break through this restriction:
1. Modify IIS applicationhost. config
Open % windir % \ system32 \ inetsrv \ config \ applicationhost. config
Find: <requestFiltering> node,
This node has no <requestLimits maxAllowedContentLength = "upload size value (unit: byte)"/> element by default, the maximum value tested on IIS 7 and IIS 7.5 is <requestLimits maxAllowedContentLength = "4294967295"/> <4 GB,
Add the following example element to this node: <requestLimits maxAllowedContentLength = "2147483647"/>. The upload size is changed to 2 GB.
Note: The % windir % \ system32 \ inetsrv \ config \ applicationhost. config file must not be replaced with files on other machines; otherwise, IIS will not be able to start
This file records all the Site and App pool information in IIS and some machine-related configurations.
2. modify web. config
<System. web>
Note: The maximum value of maxRequestLength can only be 2097151 K. If the value is greater than this value, the following error occurs:
Configuration ErrorDescription: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. Parser Error Message: The value for the property 'maxRequestLength' is not valid. The error is: The value must be inside the range 0-2097151.Source Error: Line 117:
3. If the following nodes exist under web. config (this node is designed for IIS 7), modify
<RequestLimits maxAllowedContentLength = "2147483647"/> unit and applicationhost. <requestLimits maxAllowedContentLength = "2147483647"/> in config is the same, and its maximum value is only 4294967295 <system. webServer> <security> <requestFiltering> <requestLimits maxAllowedContentLength = "2147483647"/> </requestFiltering> </security> </system. webServer>
Conclusion: The maximum size of files uploaded by asp.net (IIS 7 and IIS 7.5) cannot exceed 2 GB.