c# - Change maximum request length in asp.net mvc without modifying web.config -


as question suggest possible change maximum request length in asp.net mvc project without modifying web.config file?

the project on several client servers don't want have manually change each 1 hoping can put in global.asax write instead or similar?

edit: or possible add config file settings want overwrite?

i don't think that's possible, web config stores configuration values application uses define how behaves - in case, length of data require passed on.

you need modify web.config follows:   <configuration>     <system.web>         <httpruntime maxrequestlength="1048576" />     </system.web> </configuration> 

and if on iis7 above, following needs configured well:

<system.webserver>    <security>       <requestfiltering>          <requestlimits maxallowedcontentlength="1073741824" />       </requestfiltering>    </security>  </system.webserver> 

additional note: maxallowedcontentlength measured in bytes while maxrequestlength measured in kilobytes

some options have are:

  1. powershell script read web.config files on different servers , update configuration values accordingly.

  2. uploading web config directly via ftp or publish.

  3. modifying web config directlyon server instance.


Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -