How to force ASP loading control to accept large files?

I want to upload files using the ASP FileUpload . However, if I try to increase the limit to 10,000 kB, it does not work and accepts files up to 4 MB in size, and I get an error message indicating that the connection to the server was reset. I said: http://www.codeproject.com/KB/books/ASPNET20FileUpload.aspx and http://msdn.microsoft.com/en-us/library/aa478971.aspx , but when I changed the web.config file. comments, nothing happened. Where am I mistaken?

In addition, I wanted to know how this would work when deploying to a web server. I ask because in the code behind, I still give a hard-coded value for the path where the file should be downloaded. How it works?

+4
source share
1 answer
 <system.web> <httpRuntime maxRequestLength="102400" executionTimeout="360"/> </system.web> 

This is what you are looking for. Change the executionTimeout property in the web.config file.

According to this website ,

maxRequestLength - file size attribute limits for an ASP.NET expression. This limit can be used to prevent denial of service (DOS) attacks caused by users placing large files on the server. Size is in kilobytes. As mentioned earlier, the default is "4096" (4 MB). The maximum value is "1048576" (1 GB) for the .NET Framework 1.0 / 1.1 and "2097151" (2 GB) for the .NET Framework 2.0.

executeTimeout - indicates the attribute the maximum number of seconds during which the request is allowed to execute expression is automatically disabled. The execution of the Timeout value should always be greater than the amount of time during which the loading process may take.

+6
source

All Articles