DonPedroElBuenoI wrote:
I thought I had found the solution to my last question by myself as I found the function GetHttpRequestData().
I was wrong!
Indeed. GetHttpRequestData().content is a concatenation of all the form fields and their respective values, in the form
field1=value1&field2=value2&field3=value3&...
<cfset x = GetHttpRequestData()><cfif isBinary(x.content)>
<cfscript>
FileWrite("/tmp/binarycontent", "#x.content#");
encContent = binaryEncode("#x.content#", "Hex");
FileWrite("/tmp/encbinarycontent", "#encContent#");
</cfscript>
<cfelse>
<cffile action = "write"
file = "/tmp/nonbinarycontent"
output = "#x.content#"
addNewLine = "no"
>
</cfif>
the files /tmp/binarycontent and /tmp/encbinarycontent were written, but they were both empty.
From what I have just said, x.content is a string, not a binary. Therefore the else-block of this code will run.