Home > Uncategorized > Fix: big file uploads in IIS7 using mojoPortal CMS and NeatUpload module

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])

<neatUpload xmlns=http://www.brettle.com/neatupload/config/2008
  useHttpModule="true"
  maxNormalRequestLength="4096"
  maxRequestLength="2097151"
  multiRequestUploadHandlerUrl="~/NeatUpload/MultiRequestUploadHandler.ashx"
  maxUploadRate="300"
>
</neatUpload>

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

2) If you use IIS7 you also have to do the following (see discussion at http://forums.iis.net/p/1108662/1702390.aspx):

at an elevated (run as admin) command prompt enter (as a single long line):

%windir%\system32\inetsrv\appcmd set config "MySite/MyApp"
    
-section:requestFiltering
    
-requestLimits.maxAllowedContentLength:104857600
    
-commitpath:apphost

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:

<requestLimits maxAllowedContentLength="size_in_bytes"></requestLimits>

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.

About these ads
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 946 other followers

%d bloggers like this: