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:
powershell script read web.config files on different servers , update configuration values accordingly.
uploading web config directly via ftp or publish.
modifying web config directlyon server instance.
Comments
Post a Comment