• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFC - URi too long when passing text string to CFC

Explorer ,
Jun 26, 2008 Jun 26, 2008

Copy link to clipboard

Copied

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
TOPICS
Advanced techniques

Views

488

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Explorer , Jun 30, 2008 Jun 30, 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...

Votes

Translate

Translate
Explorer ,
Jun 26, 2008 Jun 26, 2008

Copy link to clipboard

Copied

Oh, here is an example of the GET request (I only copied like 1/100th of the string for your reading pleasure):

http://www.mondomega.com/Home/designer/DESIGNER.cfc?method=updateComInstance&returnFormat=json&argum...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jun 30, 2008 Jun 30, 2008

Copy link to clipboard

Copied

LATEST
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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation