Shared Files issue

This is the place to report bugs and get support. When posting in this forum, please always provide as much detail as possible.

Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum, do not report it as a bug.

This is the place to report bugs and get support

When posting in this forum, please try to provide as many relevant details as possible. Particularly the following:

  • What operating system were you running when the bug appeared?
  • What database platform is your site using?
  • What version of mojoPortal are you running?
  • What version of .NET do you use?
  • What steps are necessary to reproduce the issue? Compare expected results vs actual results.
Please do not report problems with a custom build or custom code in this forum. If you are producing your own build from the source code and have problems or questions, ask in the developer forum.
This thread is closed to new posts. You must sign in to post in the forums.
5/4/2012 5:03:57 AM
Gravatar
Total Posts 160
mojoPortal Community Expert
Designer of over 25 unique and custom mojoPortal sites with DMSQD and sister company, The Design Loft - www.dmsqd.com

Shared Files issue

Hi Joe

We've a site that's heavily using the shared files module, it's working great. However, when they set up a folder system, these work nicely until the folder gets full up.

When the user uploads to a folder within Shared Files that is pretty full of files, the system throws an error (see below) - however we can upload the same file into a newly created folder, so it's not a problem with the file, the type or the size.

We can work around it for now but wonder if you have any thoughts?

Thanks

Mark

--------------------------------------

Server Error in '/' Application.

Operation is not valid due to the current state of the object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Operation is not valid due to the current state of the object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[InvalidOperationException: Operation is not valid due to the current state of the object.] System.Web.HttpRequest.FillInFormCollection() +9037610 System.Web.HttpRequest.get_Form() +104 System.Web.HttpRequest.get_HasForm() +9038127 System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97 System.Web.UI.Page.DeterminePostBackMode() +69 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135

Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272

5/4/2012 7:13:42 AM
Gravatar
Total Posts 18439

Re: Shared Files issue

Hi Mark,

This problem is caused by a fairly recent ASP.NET security update that set a limit on the number of form elements (inputs, buttons, hidden fields such as viewstate) that are allowed on postback. The issue is discussed as well a workaround that allows setting a higher limit on this thread. So the short answer is that you can set a higher limit from user.config as mentioned on the other thread to avoid this error but it is best if you can organize the files so there are not so many per folder to avoid the need to set the limit too high since there was a reason they added this limit.

Hope that helps,

Joe

Joe

5/4/2012 11:09:24 AM
Gravatar
Total Posts 160
mojoPortal Community Expert
Designer of over 25 unique and custom mojoPortal sites with DMSQD and sister company, The Design Loft - www.dmsqd.com

Re: Shared Files issue

Hi Joe

Thanks for that - I increased that in user.config to something high to accommodate and test, however it didn't fix the issue - any thoughts?

Thanks

Mark

5/4/2012 11:15:39 AM
Gravatar
Total Posts 18439

Re: Shared Files issue

if that didn't fix it you didn't set it high enough, keep setting it higher until it fixes it.

Best,

Joe

5/4/2012 11:22:34 AM
Gravatar
Total Posts 160
mojoPortal Community Expert
Designer of over 25 unique and custom mojoPortal sites with DMSQD and sister company, The Design Loft - www.dmsqd.com

Re: Shared Files issue

Wow, I had it set at 7,000! But you're right, had to up it - it's a site with a big user area where they download a lot of files, and it's updated a lot daily.

Thanks again

Mark

5/4/2012 11:34:57 AM
Gravatar
Total Posts 18439

Re: Shared Files issue

If you're using an older version of mojoPortal it may have more viewstate than the latest version would. I've done some work in recent versions to reduce viewstate though the Shared Files feature does need a good bit of viewstate even when optimized.

Best,

Joe

5/4/2012 11:40:20 AM
Gravatar
Total Posts 18439

Re: Shared Files issue

Another thing you can do is increase the size of viewstate fields which won't reduce the amount of viewstate but will reduce the number of hideen viewstate fields. By making them larger fewer of them are needed.

This can be done in Web.config on the <pages element

currently it has maxPageStateFieldLength="100" which is very small, you could change it to 10000 or remove the attribute altogether and let it use whatever the default size is (I'm sure is quite a bit larger by default).

Doing that may allow you to bring that number back down quite a bit for the allowed number of form elements.

The reason I set it low was because a few years ago I read that some mobile devices have trouble with large hidden fields but I'm not so sure that is true of the modern smart phones.

Hope that helps,

Joe

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