image in jsdo base64 string

Posted by agent_008_nl on 26-Mar-2015 09:10

Nice! You can have images in blob fields in an openedge temptable, they convert to a base64 string in the jsdo and can be shown in the browse without first creating files on the disk. In js for example

var image = new Image();
image.src = "data:image/jpg;base64," + res[0].blb;

// jpg, gif or png, res[0] is here the first record and blb the temptablefieldname
document.body.appendChild(image);

It should be possible to handle audio and video in a comparable way.

https://developer.mozilla.org/en-US/Apps/Build/Audio_and_video_delivery

http://stackoverflow.com/questions/16251136/html5-play-video-from-stored-binary-string

I can imagine a funny demo (and there are serious use cases of course). ;-)

--
Kind regards,

Stefan Houtzager

Houtzager ICT consultancy & development

www.linkedin.com/in/stefanhoutzager

All Replies

Posted by egarcia on 26-Mar-2015 09:36

Hello Stefan,

Thank you for sharing this tip.

It is great that blob fields are converted to base64 strings. It certainly allows for many types of applications.

Depending on requirements, when working with large files, it would be better to use a streaming protocol.

I have not played with this but I think that it would be possible to server media from an OpenEdge backend and use HTTP Live Streaming.

Thanks.

Posted by agent_008_nl on 01-Aug-2015 07:17

Another useful one I think is the possiblity to put one or more prodatasets in json in a temptable blobfield and deserialize the base64 to json on the client. An initial read action could grab ui definitions, validations  etc., besides the initial page of data for the grid, and after that only pages of data.

 Maybe interesting for the dark room sessions (DRS) aka CSS (or CSC or CCS)? Please 50 euro's on my account for dumping this brilliant idea into the dark hole. 50 euro's not needed when you post a better idea. I'm not that bad. :-)

This thread is closed