adsense

Friday, November 18, 2016

ASP.Net MVC set maximum upload file size

ASP.NET MVC provides some configuration settings that enable to upload larger files. Adding following code snippet to web.config file will increase the maximum file upload size.

 <location path="controller/action">
   <system.web>
     <!-- specified in kilobytes (KB)  -->
    <httpRuntime maxRequestLength="15360" />  <!-- 15MB -->
   </system.web>
  <system.webServer>
     <security>
       <requestFiltering>
         <!-- specified is in bytes (B)  -->
         <requestLimits maxAllowedContentLength="15728640"/>  <!-- 15MB -->
       </requestFiltering>
     </security>
   </system.webServer>
 </location>

Cheer,
Samitha

No comments:

Post a Comment