Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: binary data in a form field gets changed

$
0
0

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.


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>