ColdFusion Fax – Retrieve Outbound Fax Image

The GetFaxImage method, demonstrated in the snippet below, retrieves the image of an outbound (previously-submitted) fax with ColdFusion.

This ColdFusion fax example snippet retrieves an image of an outbound fax:


<!--- Username and password for the Interfax account. --->
<cfset interfaxUsername = "">
<cfset interfaxPassword = "">

<cfset transactionID     = "">
<cfset Image = ToBinary("")>

<!--- Create and call the web service --->
<cfset faxWebService = CreateObject("webservice", "")>
<cfset getFaxImageResult = faxWebService.GetFaxImage(interfaxUsername, interfaxPassword, transactionID, "Image")>

<cfif getFaxImageResult eq 0>
    <cfset filename = ExpandPath(".") & "/" & transactionID & ".tif">
    <cffile action="write" file="#filename#" output="#Image#">
    Error retrieving the image:  #getFaxImageResult#