How to increase default file size limit that can be uploaded in Asp.Net?

By Santhosh N

This explains about how to change default maximum size of file that can be uploaded in Asp.Net applications.

Asp.Net imposes file size limit that can be imported from the browser. The default maximum size of the file that can be uploaded is 4MB (4096 KB). This can be changed by modifying the web.config.comments file in the machine or web.config file in the local asp.net application.


The default path where you could change the upload size is
c:\WINNT\Microsoft.NET\Framework\v4.0.30319\Config and the file to edit is

web.config.comments

you can find the node by the name <httpRuntime with the entry, maxRequestLength which you need edit.

<httpRuntime
                executionTimeout = "110" [in Seconds][number]
                maxRequestLength = "4096" [number]

Note: This has adverse effect in terms of security where in anybody could send large files to upload and eventually bringing your server down. So do this cautiously.

Related FAQs

This explains about the default maximum size of file that can be uploaded in Asp.Net applications.
At times we do encounter problems with few dialogs in visual studio or we see visual studio not responding few options
The MainMenu control is used to display the menu items and handle the events in windows forms. It has got two important things, a line seperator and Underline the alt key for shortcuts
Have you ever wondered why not have a class created without namespace in the .net (c# or vb.net or any .net language if that matters)
How to increase default file size limit that can be uploaded in Asp.Net?  (1367 Views)