You can set the limit in Web.Config
<system.web> <httpRuntime maxRequestLength="xxxxx" executionTimeout="xx"/> </system.web>
sidenote:
IIS7 rejects any file larger than 30 megabytes by default, you can enlarge it by adding the following code
<security> <requestFiltering> <requestLimits maxAllowedContentLength="XXXXXX″ /> </requestFiltering> </security>
If you want to get the size of the content before downloading, you can use the HTTP HEAD method to get the Content-Length.
Implementation
source share