Publishing images to mysql db

I’m trying to publish images to a BLOB field in a mysql database.

I have the shared image fields implemented and in my database publishing template I have the following source and binding.

<columndef action=“c” limitSizeForIndex=“n” name=“img1”>
<jdbctype>BLOB</jdbctype>
<allowsnull>yes</allowsnull>
<defaultvalue/>
</columndef>

$row.img1= $sys.item.getProperty(‘rx:img1’)
$row.$encoding.img1 = ‘base64’

Does anyone have experience publishing binary files to a database?

thanks,

Mike

Mike,

We publish images to a MS SQL database without problems. We have the following difference in the bindings vs what you posted

$row.ImageContent = $sys.item.getProperty(‘rx:image’).getValue()
$row.$encoding.ImageContent = “base64”

It seems the main difference is the call to getValue() in the bindings. Hope that helps.

Mike,

Although publishing to DB is ok, performance-wise not the best choice - it would be much better if you publish the images and other binary data to the filesystem or better CDN, while publishing the location path to the DB column instead of dumping all in DB -this is very easy and good for the DB as well.

Mike