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

Receive udp packets in android gstreamer -

matplotlib - PYTHON: Annotate boxes disapear dependant on range -

php - Extract Text from HTTP referer -