Thursday, February 2, 2012

Configure File Upload size limit In Web Config

By default, the maximum size of a file to be uploaded to a server using the ASP.NET FileUpload control is 4MB(4096kb). You cannot upload filethat is larger than this limit.

In web config we can increase the size limit using following settings.

Note:-
  • The size specified is in kilobytes.
  • This limit can be used to prevent denial of service attacks (DOS) caused by users posting large files to the server

Max value of maxRequestLength is "1048576" (1 GB) for .NET Framework 1.0/1.1 and "2097151" (2 GB) for .NET Framework 2.0.

ExecutionTimeout allows maximum number of seconds that a request is allowed to execute before being automatically shut down by the application. The executionTimeout value should always be longer than the amount of time that the upload process can take.

No comments:

Post a Comment