This content has been marked as final. Show 7 replies
Blobs are usually stored in XML in some sort of encoded format, usually Base64.
We have a component for base64 encoding and decoding. I'm not sure off the top of my head whether our SQL component handles blob types in the database. If you'd like to verify, please email support-at-avoka.com, and they'll get you an answer...
I was able to solve this using a custom component and would be glad to know any alternative approaches.
-Read the image as a blob
-encode it into base64 using apache commons base64 (org.apache.commons.codec.binary.Base64) into a byte array (there is just 1 trick here , i think its specific to oracle db)
-create a new string out of byte array and return the same.
For decoding its the reverse process
-Read the encoded string
-decode it using Base64.decodeBase64(bytearray)
-create a new blob or a file
-insert into db
In version 8.2 there is a base64 encoding exposed in the document extension for xpath.
Thanks for the update, I did try the option and it always returned an empty xml indicating that it was unable to convert it to a base64 format.
I am just trying to understand how to use the base64 encoding on the returned blob object from an underlying sql query. Is there anyway we can do it just on the blob object alone and not on every field ?
In 8.2 it is applied to a document variable so to answer your question ...No.
Here are the Xpath functions: