In the default Asp.net site, Web. config has a certain limit on the size of a single file to be uploaded. The default value is 4096 kb.
We can change the size of a single uploaded file by changing the Web. config file.
The Code is as follows:
<Httpruntime maxrequestlength = "49600" apprequestqueuelimit = "60" executiontimeout = "60"/>
Maxrequestlength indicates the size of a single uploaded file. The value is 40 MB.
You can test the configuration file by yourself. I have tried MB.
**************************************** **************************************** **************************************** *********
The content of the web. config file is roughly as follows:
<Globalization requestencoding = "gb2312" responseencoding = "gb2312"/>
<Sessionstate mode = "inproc" cookieless = "false" timeout = "20"/>
<Httpruntime maxrequestlength = "47185920">
</Httpruntime>
</System. Web>
</Configuration>
Note the location in the file,
Explanation:
<Sessionstate mode = "inproc" cookieless = "false" timeout = "20"/>
// Cookieless = "false", do not use cookies
// Timeout = "20". The session time is 20 minutes. The unit is minutes. You can modify the time here.
<Httpruntime maxrequestlength = "47185920">
// The Maximum File Uploaded By the site by default
**************************************** **************************************** *****************************
Completed in
A. maxrequestlength attribute: Used to prevent service attacks. For example, Access denied due to a large file being sent to the server. The default value is 4096 (4 MB)
.
B. executiontimeout attribute: specifies the maximum number of seconds allowed to execute a request before the ASP. NET application is automatically closed. Only when the compilation element is called
If the value of the trial attribute is false, this attribute applies. The default value is 110 S.
<Httpruntime maxrequestlength = "4096" executiontimeout = "100"/>