Fix: big file uploads in IIS7 using mojoPortal CMS and NeatUpload module
Here’s how to fix IIS7 to accept big file uploads. Tested with mojoPortal CMS and NeatUpload ASP.net component, but should apply to other ASP.net applications as well. You can also read the whole discussion at mojoPortal forums:
If you don’t use MediumTrust configuration, then check that your Web.config uses the following (an increased maxRequestLength):
btw, if you change anything at Web.config make sure you do this change every time you update mojoPortal (Web.config is overwritten and you can’t place this setting at user.config [just copy it at user.config commented out to have it handy])
1) if you use MediumTrust, then have to set "useHttpModule" to "false" and search in web.config and uncomment the "httpRuntime maxRequestLength" setting (according to NeatUpload documentation you have to use 3600 for the executionTimeout for an hour of wait not 360). Note that this setting makes your site vulnerable to DoS (Denial of Service) attacks and you also seem to lose the progress bar dialog but don’t think there’s other option in MediumTrust setting
at an elevated (run as admin) command prompt enter (as a single long line):
%windir%\system32\inetsrv\appcmd set config "MySite/MyApp"
you can verify that the setting was inserted OK by doing and checking out the output:
%windir%\system32\inetsrv\appcmd list config "MySite/MyApp" -section:requestFiltering
the command is changing the maxAllowedContentLength request limit that IIS7 requestFiltering (the replacement for urlscan) has introduced
NeatUpload documentation also mentions the following alternative regarding the IIS7 issue:
(Optional) To allow larger uploads than the 30MB default used by IIS7, add the following to your Web.config under the configuration/system.webServer/security/requestFiltering section:
Note that for such a change to be allowed, you or your hosting provider might need to change the machine’s %SystemRoot%/system32/inetserv/config/applicationHost.config file such that the overrideModeDefault attribute for the requestFiltering section is Allow instead of Deny.