I have a form page that is expecting to receive a form variable
containing a Base64 string submitted from a vendor. I keep getting a
message that the input and output encodings are not the same or the
paraemter isn't a Base64 encoded string, depending on the way I try and
do the Base64 decoding. I can't post all of my original code, but I
created a test script that generates the same result. Here it is:


On test form submittal page

<cfset plainString = "<data><dataTable>High there</dataTable></data>">
<cfoutput>#XmlFormat(plainString)#</cfoutput>

<form action="formAction.cfm" method="post">
        <cfoutput>
                <input type="hidden" name="base64String"
value="#ToBase64(plainString)#">
        </cfoutput>
        <input type="submit" value="Submit">
</form>

On the form action page

<!--- New Way --->
<cfoutput>#CharsetEncode(BinaryDecode(form.base64String,"Base64"),"utf-8
")#</cfoutput> 
<!--- Old Way --->
<cfoutput>#ToString(ToBinary(form.base64String),"utf-8")#</cfoutput>

The Base64 string I'm receiving is an XML string. If I change the method
above to get and replace form with url on the action page, everything
works fine. I'm running CFMX 7.0.2 on IIS 5.1. I'm thinking there
something else I need to be doing on the action page with encoding, but
CFHEADER didn't affect anything. Any help or thoughts would be
appreciated. Thanks,

Phil



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Macromedia ColdFusion MX7
Upgrade to MX7 & experience time-saving features, more productivity.
http://www.adobe.com/products/coldfusion?sdid=RVJW

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:273897
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to