Skip to main content
WolfShade
Legend
February 9, 2011
Question

Made some progress, still need help: Image upload/insert SQL

  • February 9, 2011
  • 1 reply
  • 382 views

Hello, everyone.

I've made some progress, since the last time I posted about file uploads.  Still need a bit of help, though.

I _finally_ have code in place that will upload a file from a client computer and immediately readbinary that data into a variable.

I've tested this with the CFIMAGE tag using WriteToBrowser as the action - it works!!  Wonderfully!

Now I need to insert that into the database.  I'm getting "ByteArray cannot be converted into string" messages.  I've tried ToString(), ToBase64(), yadda yadda yadda.  How can I take this variable that contains BINARY data and insert it into a SQL Server 2000 database column set to datatype IMAGE?

Thanks,

^_^

    This topic has been closed for replies.

    1 reply

    WolfShade
    WolfShadeAuthor
    Legend
    February 9, 2011

    .. and now that I think of it..

    How would I SELECT that image data and give it to a CFIMAGE tag with WriteToBrowser if it can't be converted to string??

    Thanks,

    ^_^

    WolfShade
    WolfShadeAuthor
    Legend
    February 9, 2011

    Found it:

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

    ^_^