How to read FieldTypeBlob from graphic.attributes

3294
2
06-18-2013 10:20 PM
JosephineREgina
New Contributor
I've bytea field type in postgis database and bytea i.e Blob datatype is not displayed in graphic.attributes.
Using the rest service url the field has value <blob>.But I need to know how to read the blob value and display as images.
http://hostname/arcgis/rest/services/service/FeatureServer/1/1/htmlpopup

Is it possible to read the blob value in arcgis javascript API?
0 Kudos
2 Replies
ReneRubalcava
Frequent Contributor
If the blob is an image, it's probably a base64 endcoded image, which means you can display it in your html by adding data:image/png;base64 in front of the string in a popup or somewhere else. Change image type based on what it is.

So as an infotemplate, you might write it as
<img src="data:image/gif;base64,${IMAGE_FIELDNAME}" />
0 Kudos
JacksonGilman1
New Contributor III
You might also find use for the dojox/encoding/base64 module

http://dojotoolkit.org/reference-guide/1.9/dojox/encoding/base64.html
0 Kudos