Skip to main content
Inspiring
June 27, 2008
Answered

CFC - URi too long when passing text string to CFC

  • June 27, 2008
  • 2 replies
  • 610 views
I have a page that allows a user to save a large block of text which is held within a <div> to the database without reloading the page by way of cfajaxproxy and a cfc.

Upon clicking 'save' a javascript function pulls the block of text out of the div and saves it to a javascript string, which is then passed into a cfc by way of cfajaxproxy as a javascript function parameter. (ie. functionName(theTextBlockString);). This works just fine unless the text contained within that javascript string var gets too long and causes a URi too long message.

Viewing the request in firebug I can see that the cfc is called via a GET request, which causes all of my input parameters that I've placed in the function to be placed in a GET url string, so obviously when it is a long block of text the URL string gets too long and I get the URi too long message from the CFC.

What I'm trying to figure out is how on earth I can pass a large text string into the CFC without encountering this problem. Is there an alternative request method so that I don't have to use GET?

Thank you in advance!

Dave
This topic has been closed for replies.
Correct answer Dstharding
I found the setHTTPMethod parameter used when initializing a cfc for cfajaxproxy - you can change it to POST which obviously solves the problem. Adobe, make POST the default like CFAjax, AJaxCFC, etc!!! Maybe theres some obscure reason to have GET default, who knows...

2 replies

DsthardingAuthorCorrect answer
Inspiring
July 1, 2008
I found the setHTTPMethod parameter used when initializing a cfc for cfajaxproxy - you can change it to POST which obviously solves the problem. Adobe, make POST the default like CFAjax, AJaxCFC, etc!!! Maybe theres some obscure reason to have GET default, who knows...