Hi,
I've uploaded an image (png) as a resource using ftp. Now I'd like to extract the contents of the png file using the resource_view.
In my test the uploaded file was placed in /public/tmp and was named test.png.
Using the following query I tried to get the data:
SELECT extract(res,'/Resource/Contents/binary') AS content, extractValue(res,'/Resource/ContentType') AS ContentType
FROM resource_view
WHERE equals_path(res,'/public/tmp/test.png') = 1
The output was something like:
<binary xmlns="http://xmlns.oracle.com/xdb/XDBResource.xsd">89504E470D0A1A0A0000000D494844520000023E00000181080300000051984BA3000003
00504C5445000000BF000000BF00BFBF000000BFBF00BF00BFBFC0C0C0C0DCC0A4C8F0111111222222444444555555777777AAAAAADDDDDDEEEEEE00001100002200
00440000550000770000880000AA0000BB0000DD0000EE00110000220000440000550000770000880000AA0000DD0000EE0011000022000044000055000077000088...</binary>
image/png
This looks a lot like ASCII :-) Following the XSD the binary data is hexBinary encoded.
My question is how to get the binary representation?
(oh, I'm running 11g on 64bits Windows)
Edited by: Tijink on Feb 2, 2009 3:20 AM