Tobinary - MACROMEDIA COLDFUSION 4.5-CFML LANGUAGE Reference

Cfml language reference
Table of Contents

Advertisement

Chapter 2: ColdFusion Functions

ToBinary

Returns the binary representation of Base64 encoded data.
See
CFFILE
information about serializing and deserializing binary data, and
ToBase64
Len
for determining the length of a binary object.
Syntax
ToBinary( string_in_Base64 or binary_value)
string_in_Base64 or binary_value
String in Base 64 that is to be converted to binary or binary value that is to be
tested to ensure that it is an acceptable binary value.
Usage
Base 64 provides 6 bit encoding of 8-bit ASCII characters.If you receive data in Base 64,
you can re-create the actual binary object that it represents, such as a .gif , .jpeg, or
executable file, by using the ToBinary function.
Examples
<!--- This example shows the use of ToBinary and ToBase64 --->
<HTML>
<HEAD>
<TITLE>
ToBinary Example
</TITLE>
</HEAD>
<BASEFONT FACE="Arial, Helvetica" SIZE=2>
<BODY
<H3>ToBinary Example</H3>
<!----------------------------------------------------------------------
Initialize data.
----------------------------------------------------------------------->
<CFSET charData ="">
<!----------------------------------------------------------------------
Create a string of all ASCII characters (32-255) and concatenate them
together.
----------------------------------------------------------------------->
<CFLOOP index="data" from="32" to="255">
<CFSET ch=chr(data)>
<CFSET charData=charData & ch>
</CFLOOP>
<P>
The following string is the concatenation of all characters (32 to 255)
from the ASCII table.<BR>
<CFOUTPUT>#charData#</CFOUTPUT>
</P>
for information about loading and reading binary data,
for checking for binary data and converting it into printable form. See also
bgcolor="#FFFFD5">
545
CFWDDX
for
IsBinary
and

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION 4.5-CFML LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion 4.5

Table of Contents