In. net, only files smaller than 4 MB can be uploaded, and pages cannot be displayed if they are larger than 4 MB. How can we set imputfile to upload larger files,
1. Environment: Window 2003, iis6.0
First, you must modify the maximum number of ASP requests in iis6.0. The default value is 200 K;
Method: Open metabase. XML in c: \ windows \ system32 \ inetsrv,
Modify aspmaxrequestentityallowed for the value you need (such as "1073741824", 1 GB );
Technical Background:
In IIS 6.0, the aspmaxrequestentityallowed attribute specifies the maximum number of bytes that an ASP request can use. if the request length contained in the Content-Length header exceeds the value of aspmaxrequestentityallowed, IIS returns a 403 error message.
This attribute value is similar to maxrequestentityallowed, but is for ASP requests. if you know that your ASP application only needs to process a small amount of request data, you can set the global maxrequestentityallowed attribute at the World Wide Web Hing Service (WWW Publishing Service) level to 1 MB, set aspmaxrequestentityallowed to a smaller value.
Note: Stop the IIS service before editing the file. Otherwise, the modified file cannot be saved.
It can also be solved as follows:
IIS6 Resource Kit tools (http://www.microsoft.com/downloads/details.aspx? Familyid = metric & displaylang = EN). After installation, you modified the attribute (local) \ lm \ W3SVC \ aspmaxrequestentityallowed (200 k = 204800 by default) using metabase explorer and changed it to 1 GB; at the same time, the aspscripttimeout attribute is modified to adjust the time limit so that you can upload large files.
2, in. net
(1) Add an httpruntime primary key to the Web. comfig file.
<Httpruntime executiontimeout = "90" maxrequestlength = "40960" usefullyqualifiedredirecturl = "false"
Minfreethreads = "8" minlocalrequestfreethreads = "4" apprequestqueuelimit = "100"/>
Maxrequestlength = "40960" indicates the maximum number of requests. The unit is K.
(2) modify the c: \ windows \ Microsoft. NET \ framework \ v1.1.4322 \ config \ machine. config file
<Httpruntime executiontimeout = "190" maxrequestlength = "40960"
Maxrequestlength = "40960" indicates the maximum number of requests. The unit is K.
After the experiment, (1) and (2) only one can be used.