#1 2015-08-10 19:29:20

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 336

How read a TSQLRawBlob field containing an image from a TSynDBDataset?

Hi ab,

   I tried (from a wrong way surely) read a binary content from a TSQLRawBlob field to a TBitmap. How I must read the base64 encoded (with magic) TSQLRawBlob field ? A sample code it helps me much. I'm not using TSQLRecord from client side.

Thanks in advance.

EMartin.


Esteban

Offline

#2 2015-08-11 06:43:11

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: How read a TSQLRawBlob field containing an image from a TSynDBDataset?

Just read the blob with a GET on its URI.

For instance, a TSQLMyTable.Blob: TSQLRawBlob field should be directly accessible from

GET root/mytable/1234/blob

root being the "root" of the Model
and 1234 being the ID of the Record

RTFM at http://synopse.info/files/html/Synopse% … tml#TITL_1

Offline

#3 2015-08-11 13:45:17

EMartin
Member
From: Buenos Aires - Argentina
Registered: 2013-01-09
Posts: 336

Re: How read a TSQLRawBlob field containing an image from a TSynDBDataset?

Ab, I can get the content from the blob field, but how convert to bitmap for example ? Digging in the code I can see that magic base64 encode, but if I use Base64MagicDecode the return value is empty.

Thanks.


Esteban

Offline

#4 2015-08-11 19:28:57

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,272
Website

Re: How read a TSQLRawBlob field containing an image from a TSynDBDataset?

If you use GET root/mytable/1234/blob, it will return the bitmap as raw binary, with the good MiME type in the HTTP headers.

Offline

Board footer

Powered by FluxBB