Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ColdFusion HTTP POST large strings

Tags:

coldfusion

Has anyone noticed that if you try to post a string that exceeds 1,000,000 characters, it simply does not include the field with the request?

...and doesn't throw()!

eg.

<cfscript>
var h = new http( url = "http://...", method = "post" );
h.addParam( type = "formField", name = "a", value = repeatString("a",5000) );
h.addParam( type = "formField", name = "b", value = repeatString("b",1000000) );
h.addParam( type = "formField", name = "c", value = repeatString("c",1000001) );
var p = h.send().getPrefix();
writeDump( var = p, abort = true );
</cfscript>

The "a" and "b" fields are present in the form scope of the recipient page.

The "c" field is missing!

ColdFusion 9,0,1,274733 + chf9010002.jar, Mac OS X 10.6.8, Java 1.6.0_31

Edit: It now works as expected!

Not sure what has changed? My cf admin configuration remains the same. The only possible candidate I can come up with is a recent Apple Java update. Could that be it?

like image 652
Mike Causer Avatar asked Mar 21 '26 07:03

Mike Causer


1 Answers

You may need to specify

enctype="multipart/form-data"

like image 137
Dale Fraser Avatar answered Mar 23 '26 14:03

Dale Fraser



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!