tracker issue : CF-3700163

select a category, or use search below
(searches all categories and all time range)

The function gethttpRequestData() fails when form posted with encType="multipart/form-data"

| View in Tracker

Status/Resolution/Reason: Closed/Fixed/

Reporter/Name(from Bugbase): A. Bakia / A. Bakia (A. Bakia)

Created: 01/28/2014

Components: Language

Versions: 10.0

Failure Type: Non Functioning

Found In Build/Fixed In Build: Final / CF11 Update5

Priority/Frequency: Critical / All users will encounter

Locale/System: English / Windows 7 64-bit

Vote Count: 2

Listed in the version Issues Fixed doc
Problem Description: The function gethttpRequestData() fails to function as expected when a form is submitted with attributes method="post" and encType="multipart/form-data".

Steps to Reproduce:run the following code:

 1) Run the following code:

<cfif isDefined("Form.fieldContent")>
    isBinary(gethttpRequestData().content): #isBinary(gethttpRequestData().content)#<br>
    binaryEncode(gethttpRequestData().content, 'hex'): #binaryEncode(gethttpRequestData().content, 'hex')#<br>
    <cfdump var="#gethttpRequestData().content#" label="gethttpRequestData().content dump">
   <cffile action="write" file="#expandPath('testBinary')#" output="#gethttpRequestData().content#">
<cfoutput><form method="post" action="#cgi.SCRIPT_NAME#" enctype="multipart/form-data"></cfoutput>
<input name="fieldContent" type="text">
<input name="sbmt" type="submit" value="Send">

2) Enter 0123456789 in the text field and submit the form. 

Actual Result:
a) isBinary(gethttpRequestData().content) returns 'Yes'.
b) binaryEncode(gethttpRequestData().content, 'hex') returns an empty string.
c) The dump shows no detail, is therefore apparently blank.
d) The file, testBinary, is created, but has 0 bytes.

Expected Result: I expected the following
a) isBinary(gethttpRequestData().content) to return 'Yes'.
b) binaryEncode(gethttpRequestData().content, 'hex') to return a non-empty, hex-encoded string.
c) The dump to show a table consisting of rows of data.
d) The file, testBinary, to be created, and to contain the data from the form.

Any Workarounds:

----------------------------- Additional Watson Details -----------------------------

Watson Bug ID:	3700163

External Customer Info:
External Company:  
External Customer Name: BKBK
External Customer Email:  
External Test Config: My Hardware and Environment details:



I ran the same code on Railo and got the expected result! For details, follow this link to the ColdFusion forum:
Comment by External U.
13594 | January 28, 2014 07:41:22 AM GMT
Very important issue for us. Hope to have this fixed soon.
Vote by External U.
13598 | January 29, 2014 03:43:17 AM GMT
I get the same issue on Windows and Solaris. On Solaris I also get this with “application/octet-stream” . I use it for chunking large files. Works in Cold Fusion 9 on Solaris but not 11. It also works on Windows in 11. We are about to upgrade our production environment and this is a major issue for us.
Vote by External U.
13599 | December 15, 2014 07:13:59 AM GMT
Like in ColdFusion 9, With the fix in place, for this to work, user has to pass the following argument in jvm.config. -Dcoldfusion.markResetForMultiPart=true
Comment by Krishna R.
13595 | February 10, 2015 01:03:18 AM GMT
The fix for this bug is available in the pre-release build of ColdFusion 11 Update 5
Comment by CFwatson U.
13596 | February 20, 2015 09:26:08 AM GMT
Verified this is fixed in CF11 Update 5 (build 11,0,05,293506). The -Dcoldfusion.markResetForMultiPart=true JVM arg is honored again. Thanks!, -Aaron
Comment by External U.
13597 | November 20, 2015 05:19:47 AM GMT