Changes to web.config for larger files causes 500 Server Error

If you have questions about using mojoPortal, you can post them here.

You may want to first review our site administration documentation to see if your question is answered there.

This thread is closed to new posts. You must sign in to post in the forums.
2/29/2012 11:41:16 AM
Gravatar
Total Posts 104

Changes to web.config for larger files causes 500 Server Error

Not sure where to post this question, but any changes that I make to the web.config file in regard to larger files sizes (where I am uncommenting something that was already included), it causes a 500 Server Error... any ideas as to how to address this?

2/29/2012 11:56:55 AM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Changes to web.config for larger files causes 500 Server Error

First you should take a look at the Basic Troubleshooting document. Once you've determined the error you're getting, if you can't figure it out then post it here for additional help.

One tip I can offer is that you can't use a double dash (--) in your config file comments. That's caught me out before and it can be hard to debug.

Jamie

2/29/2012 11:56:57 AM
Gravatar
Total Posts 18439

Re: Changes to web.config for larger files causes 500 Server Error

any kind of typo in Web.config can break it and cause it to fail loading the Web.config file so you need to be very careful about changes to Web.config. If you un-comment something related to NeatUpload and you are in Medium Trust hosting it will cause errors as well.

Everything I know about supporting large file uploads is in the article Supporting Large File Uploads.

Hope that helps,

Joe

2/29/2012 12:24:04 PM
Gravatar
Total Posts 104

Re: Changes to web.config for larger files causes 500 Server Error

Thanks for the information - sure seems to be related to the max file size when i look in the log...

System.Web.HttpException (0x80004005): Maximum request length exceeded.

...in the web.config file, I am just trying to change this:

    <!-- This sets the max size of an upload if the UploadHttpModule is not being used (i.e.
commented out because it can't work in medium trust).  In that case, theentire
request is stored in memory, so large uploads could be used as a Denial of Service
attack. Use you own judgement in determining the max size ofa request you want to allow.
<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />
-->

to this:


<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />

...and then I get the 500 Server Error...

2/29/2012 12:26:02 PM
Gravatar
Total Posts 104

Re: Changes to web.config for larger files causes 500 Server Error

so it looks like there are all kind of comment lines using the double dash (<!--    -->)... but it seems to be working fine until I make the change above...

2/29/2012 12:47:43 PM
Gravatar
Total Posts 104

Re: Changes to web.config for larger files causes 500 Server Error

it looks like one cannot have two httpRuntime lines in the config file... so would I want to combine all of the attributes into one?

before:

    <!-- This sets the max size of an upload if the UploadHttpModule is not being used (i.e.
commented out because it can't work in medium trust).  In that case, theentire
request is stored in memory, so large uploads could be used as a Denial of Service
attack. Use you own judgement in determining the max size ofa request you want to allow.
<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />
-->
<httpRuntime requestValidationMode="2.0" maxUrlLength="560" maxQueryStringLength="2048"  />

after (allows uploading large file):


<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />

error (causes 500 Server Error):


<httpRuntime maxRequestLength="2097151" executionTimeout="3600" useFullyQualifiedRedirectUrl="true" />
<httpRuntime requestValidationMode="2.0" maxUrlLength="560" maxQueryStringLength="2048"  />

2/29/2012 12:54:01 PM
Gravatar
Total Posts 1203
Proud member of the mojoPortal team

Help support mojoPortal!
Add-on modules

Re: Changes to web.config for larger files causes 500 Server Error

Yes, combine the parameters into one httpRuntime statement.

The double dash in <!-- and --> are part of the syntax. My comment about double dash in comments was that you can't do something like this:

<!-- This is a comment--and it is completely illegal. -->

But that's not relevant to your problem here.

2/29/2012 1:08:38 PM
Gravatar
Total Posts 104

Re: Changes to web.config for larger files causes 500 Server Error

ok great!  just wasn't sure if you could have more than one httpRuntime node or not...

and thanks for the info on the comments - I didn't know that before :D

You must sign in to post in the forums. This thread is closed to new posts.