Don Pedro,
I have been busy testing the behaviour of getHttpRequestData(), when a form is submitted with method="post" and enctype="multipart/form-data". I am on ColdFusion 10.0.13.287689.
Now, I can fully understand your frustration. I am, unfortunately, about to dash your hopes even further.
You were correct in expecting getHttpRequestData() to return the complete post that the client sent. That is in fact what its function is. However, I have found that the scenario I describe in the first paragraph leads to a bug.
To reproduce the bug, run the following code:
<cfif isDefined("Form.fieldContent")>
<cfoutput>
isBinary(gethttpRequestData().content): #isBinary(gethttpRequestData().content)#<br>
binaryEncode(gethttpRequestData().content, 'hex'): #binaryEncode(gethttpRequestData().content, 'hex')#<br>
</cfoutput>
<cfdump var="#gethttpRequestData().content#" label="gethttpRequestData().content dump">
<cffile action="write" file="#expandPath('testBinary')#" output="#gethttpRequestData().content#">
</cfif>
<cfoutput><form method="post" action="#cgi.SCRIPT_NAME#" enctype="multipart/form-data"></cfoutput>
<input name="fieldContent" type="text">
<br>
<input name="sbmt" type="submit" value="Send">
</form>
Enter '0123456789' in the text field and submit the form. The result is as follows:
1) isBinary(gethttpRequestData().content) returns 'Yes'.
2) binaryEncode(gethttpRequestData().content, 'hex') returns an empty string.
3) The dump shows no detail, is therefore apparently blank.
4) The file, testBinary, is created, but has 0 bytes.
For a second opinion, I ran the same code on Railo 4.1.2.005. This version corresponds to ColdFusion 10. The Railo result was as follows:
1) isBinary(gethttpRequestData().content) returned 'true'.
2) binaryEncode(gethttpRequestData().content, 'hex') returned the string 2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D32303133303 136383935373631330D0A436F6E74656E742D446973706F736974696F6E3A20666F726 D2D646174613B206E616D653D226669656C64436F6E74656E74220D0A0D0A303132333 435363738390D0A2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2 D2D32303133303136383935373631330D0A436F6E74656E742D446973706F736974696 F6E3A20666F726D2D646174613B206E616D653D2273626D74220D0A0D0A53656E640D0 A2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D2D32303133303 136383935373631332D2D0D0A
3) The dump returned a table entitled 'Native Array (byte[])', consisting of 2 rows. The contents of the rows were as follows:
First row
Column 1: Raw
Column 2: [45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45 ,45,45,45,45,45,45,50,48,49,51,48,49,54,56,57,53,55,54,49,51,13,10,67, 111,110,116,101,110,116,45,68,105,115,112,111,115,105,116,105,111,110, 58,32,102,111,114,109,45,100,97,116,97,59,32,110,97,109,101,61,34,102, 105,101,108,100,67,111,110,116,101,110,116,34,13,10,13,10,48,49,50,51, 52,53,54,55,56,57,13,10,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,4 5,45,45,45,45,45,45,45,45,45,45,45,45,45,50,48,49,51,48,49,54,56,57,53 ,55,54,49,51,13,10,67,111,110,116,101,110,116,45,68,105,115,112,111,11 5,105,116,105,111,110,58,32,102,111,114,109,45,100,97,116,97,59,32,110 ,97,109,101,61,34,115,98,109,116,34,13,10,13,10,83,101,110,100,13,10,4 5,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45,45 ,45,45,45,45,45,50,48,49,51,48,49,54,56,57,53,55,54,49,51,45,45,13,10]
Second row
Column 1: Base64 Encoded
Column 2: LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0yMDEzMDE2ODk1NzYxMw0KQ29udGVudC 1EaXNwb3NpdGlvbjogZm9ybS1kYXRhOyBuYW1lPSJmaWVsZENvbnRlbnQiDQoNCjAxMjM0 NTY3ODkNCi0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tMjAxMzAxNjg5NTc2MTMNCk NvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0ic2JtdCINCg0KU2VuZA0K LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0yMDEzMDE2ODk1NzYxMy0tDQo=
4) The file, testBinary, is created. It has 257 bytes, and the following content:
-----------------------------20130168957613
Content-Disposition: form-data; name="fieldContent"
0123456789
-----------------------------20130168957613
Content-Disposition: form-data; name="sbmt"
Send
-----------------------------20130168957613--