how to display image stored in a blob field

Posted by mflanegan on 03-Nov-2014 04:02

Hi there

Does anyone know how to display an image or steps to display an image stored in a blob field on the db to an image control on the client?

Thanks,

meyrick

All Replies

Posted by James Palmer on 03-Nov-2014 04:37

You'll have to use the COPY-LOB keyword to copy it to a temporary location to then display in the client I think. Remember to clean it up afterwards as well.

Posted by mflanegan on 03-Nov-2014 04:37
Hi
 
I am using progress mobile with a mobile data grid and the image is being populated in each row.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


 
Posted by mflanegan on 03-Nov-2014 04:42
How do I write the data returned in the blob field to disk on the mobile device using javascript?
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


 
Posted by egarcia on 04-Nov-2014 06:59

Hello Meyrick,

A possible way to do this is to write the image file to a web server and provide the URL to the client to access it.

However, I believe that you want to use the base64 encoded image returned from a READ or INVOKE operation to the Mobile app.

Even though I have not tried this myself, you should be able to use the concept of Data URI scheme, where you can specify a base64 encoded image as the src of an image component.

Please take a look at the info in the following article (found via DuckDuckGo):

   stackoverflow.com/.../embedding-base64-images

I hope this helps.

Posted by mflanegan on 05-Nov-2014 01:59
Hi Edsel
 
We are following the same concept. Once the image is sent to the control on the client side I get this message in the debugger:
 
Resource interpreted as Image but transferred with MIME type text/html
 
Perhaps you know a way around this?
 
Thanks in advance.
 

Meyrick Flanegan

Developer - Managed Services

Email: mflanegan@elcb.co.za

 

ELCB Information Services (Pty) Ltd

Customer Service Email  elcb@elcb.co.za · www.elcb.co.za

E A S T  L O N D O N

Tel: +27(43)  704 0700

Fax: +27(43) 704 0701

J O H A N N E S B U R G

Tel: +27(11) 879 6179

Fax: +27(11) 454 0384

P O R T  E L I Z A B E T H

Tel: +27(41) 373 0529

Fax: +27(86) 650 0135

Disclaimer


[collapse]
From: egarcia [mailto:bounce-egarcia@community.progress.com]
Sent: 04 November 2014 03:00 PM
To: TU.Mobile@community.progress.com
Subject: RE: [Technical Users - Mobile] how to display image stored in a blob field
 
Reply by egarcia

Hello Meyrick,

A possible way to do this is to write the image file to a web server and provide the URL to the client to access it.

However, I believe that you want to use the base64 encoded image returned from a READ or INVOKE operation to the Mobile app.

Even though I have not tried this myself, you should be able to use the concept of Data URI scheme, where you can specify a base64 encoded image as the src of an image component.

Please take a look at the info in the following article (found via DuckDuckGo):

   stackoverflow.com/.../embedding-base64-images

I hope this helps.

Stop receiving emails on this subject.

Flag this post as spam/abuse.

[/collapse]
This thread is closed