Skip to main content
Participant
June 9, 2010
Question

PDF binary variable won't save in Oracle blob

  • June 9, 2010
  • 1 reply
  • 2431 views

I am reading in a small, legitimate PDF as a binary variable and them immediately saving that variable into a blob. But the blob doesn't store the data.

<cffile action="readbinary" file="C:\Test_Files\test.pdf" variable="testdoc">

now shows isbinary(testdoc) = YES

In fact, I can output to the screen using cfcontent, and it displays fine.

But if I try to save the testdoc variable to an Oracle blob, CF seems to think it is trying to insert an empty variable.

<cfquery name="ins" datasource="#request.a_datasource#">

INSERT

INTO PROD_WCT.T_DOCS (

PDF_BLOB

)

VALUES (

<cfqueryparam value="#testdoc#" cfsqltype="CF_SQL_BLOB">

)

Now if I retrieve that row (query name=”get_pdf”) and check the value, it appears empty:

now shows isbinary(get_pdf.pdf_blob) = NO

Nothing is done in betweent the cffile and the insert. Any ideas?

    This topic has been closed for replies.

    1 reply

    ilssac
    Inspiring
    June 9, 2010

    You have activiated the ability to work with BLOB data in your data source name configuration in the ColdFusion Administrator right?

    BLOB data can be a big preformance hit to data connections.  They are not enabled by default.

    awi_flaAuthor
    Participant
    June 9, 2010

    Yes, in cfadmin I have checked the box to enable blobs under the datasource.

    Participant
    June 22, 2010

    http://awads.net/wp/2006/02/21/lobs-gotcha-in-coldfusion/