5

I have a rather long form (1000 checkboxes) that the customer goes through to order. But I get the following error when it goes over a certain limit (100 items):

Failed to add HTML header.ColdFusion was unable to add the header you specified to the output stream. This is probably because you have already used a cfflush tag in your template or buffered output is turned off

Q: Is that an IIS setting or a ColdFusion administrator setting?

I did some research before posting this question, and it doesn't have to do with AJAX and debug settings. All debug settings are turned off and I get the error on form submit.

Phillip Senn
  • 46,771
  • 90
  • 257
  • 373
  • 1
    Since it's a ColdFusion error it would seem to make sense to start there, and then work your way through to the web server if you need to. IIS does have a config setting for max content length on a request, so that would be the first place I'd go after checking ColdFusion. – Brian Driscoll Dec 19 '12 at 17:09
  • 1
    Please confirm that you get the error when you post the form as opposed to when you generate it. Otherwise elaborate on "I get the error on form submit". – Dan Bracuk Dec 19 '12 at 17:17
  • OK, thanks Brian! In simplifying the problem so that I can show it to my hosting provider, I haven't been able to boil it down to a simple page where I can show it to them yet. Although on the "real" page, when I put a limit to the number of rows that are being served, it works, so I'm pretty sure I'm close to what's causing the problem. – Phillip Senn Dec 19 '12 at 17:19
  • Yeah, it's when I submit the form, not when the form is generated. And if I limit the number of rows, I don't get the error on form submit. – Phillip Senn Dec 19 '12 at 17:21
  • If you start the processing page with cfabort do you still get an error? – Dan Bracuk Dec 19 '12 at 17:22
  • OK, it's because every item also has a select tag associated with it, asking the customer to choose a qty from a dropdown. Probably not the greatest UI. But I have been able to simplify it down to a proof-of-concept level now. – Phillip Senn Dec 19 '12 at 17:27
  • For newer versions of ColdFusion see: https://stackoverflow.com/questions/55673021/how-to-fix-post-request-exceeded-error-while-we-passed-the-number-of-parameter – James A Mohler Apr 14 '19 at 17:40

2 Answers2

11

Does your form POST or GET? If it's a GET you may be maxing out the URL length limit. If it's a POST, then you are probably running into the limit in CF on the number of form fields. This article details how to modify the value.

You may want to consider other ways of sending that data to the server. Perhaps using jQuery to serialise the form and send the JSON as a single parameter?

Leigh
  • 28,765
  • 10
  • 55
  • 103
barnyr
  • 5,678
  • 21
  • 28
  • That's what did it! Yeah! I went into the administrator and there's an input: Maximum number of POST request parameters Maximum number of parameters in a POST request sent to the server. ColdFusion rejects requests if the POST parameters exceed the limit you specify. – Phillip Senn Dec 19 '12 at 18:20
6

Sounds very similar to an error we had after moving a site with a large number of fields to a new environment. our error read a bit different but you could be getting a different error depending on what you're doing.

500

ROOT CAUSE: coldfusion.filter.FormScope$PostParametersLimitExceededException: POST parameters exceeds the maximum limit specified in the server.

There is a coldfusion setting in your runtime.xml file you could try changing or removing:

<var name='postParametersLimit'><number>100.0</number></var>
Community
  • 1
  • 1
genericHCU
  • 4,394
  • 2
  • 22
  • 34
  • This change was introduced in the March 2012 CF 9 hotfix from Adobe. It's also rolled up into CF 9.0.2: See http://www.webtrenches.com/post.cfm/adobe-coldfusion-9-hotfix-apsb12-06-causes-problems-with-large-forms – Brian Dec 19 '12 at 19:17