|

How to increase the max upload file size in ASP.NET?

To increase the max upload file size in ASP.NET, you can modify the configuration settings in the web.config file of your application. Here are the steps to follow:

  1. Open the web.config file in your ASP.NET application using a text editor.
  2. Locate the <system.web> section within the file.
  3. Within the <system.web> section, add the following lines of code to increase the max upload file size to 50 MB (for example):
<httpRuntime maxRequestLength="51200" />
<requestLimits maxAllowedContentLength="52428800" />
  1. The maxRequestLength attribute specifies the maximum size of the request in kilobytes (KB). In this example, it is set to 50 MB, or 51200 KB. The maxAllowedContentLength attribute specifies the maximum length of content in a request in bytes. In this example, it is set to 50 MB, or 52428800 bytes.
  2. Save the web.config file.

These changes should increase the maximum file size that can be uploaded to your ASP.NET application. However, keep in mind that there may be other factors, such as server configuration or browser limitations, that could affect the maximum file size that can be uploaded.

Spread the love

Similar Posts