Is 7 default file upload size 30 m
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>
<HttpruntimeExecutiontimeout= "36000"Maxrequestlength= "2097151"/><! --Maxrequestlength: size of the upload, in the unit of K, executiontimeout: Set the timeout time, in the unit of seconds. (90 seconds by default)-->
</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 Error
Description: 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: < Httphandlers />
Line 118: < Customerrors Mode = "Remoteonly" />
Line 119: < Httpruntime Executiontimeout = "36000" Maxrequestlength = "4194304" />
Line 120: < Authentication Mode = "Windows" />
Line 121: < Identity Impersonate = "True" />
3. If the following nodes exist under Web. config (this node is designed for IIS 7), modify
< Requestlimits Maxallowedcontentlength = "2147483647" /> Unit and in applicationhost. config < Requestlimits Maxallowedcontentlength = "2147483647" /> The 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.