Skip to main content
February 25, 2011
Question

Decoder cannot decode input

  • February 25, 2011
  • 2 replies
  • 2117 views

Hello everybody,

I try to create a new image with a blob coming from a database, but when I execute the following instructions, ColdFusion returns me an error message "Decoder cannot decode input."

<cfquery name="qData" datasource="MyDS">
SELECT a.BLOB_DOC
FROM TOFFDOC a
WHERE a.CLE_DOC = #URL.cledoc# AND
a.TYP_DOC = 'JPG'
</cfquery>

<cfset myOriginalImage=ImageNew(qData.blob_doc)>

I use Coldfusion 9.0.1.274733 enterprise edition on a Windows server 2003 and Sysbase Sql Anywhere 11 for the database.

An idea ?

    This topic has been closed for replies.

    2 replies

    February 25, 2011

    Yes, I checked the CLOB and BLOB options  in the advanced settings of the datasource

    Inspiring
    February 25, 2011

    If you view the blob field's contents is the result a base 64 encoded string? If so you may need to wrap a call to the ToBinary function around the field when using it is a parameter for the ImageNew function.

    February 25, 2011

    Hi, Thanks for your answer

    Sorry, I forgot to specify that the code works fine when I retrieve a small BLOB image (less than 400k), for the bigger images it raises an exception.  I also tried to use the ToBase64() conversion function but I always have the same error.

    Regards

    Inspiring
    February 25, 2011

    Does your CF datasource have the BLOB option enabled?


    See:
    http://help.adobe.com/en_US/ColdFusion/9.0/Admin/WSc3ff6d0ea77859461172e0811cbf364104-7fe0.html