Image file use in the application

This forum contains topics that were moved from Get Satisfaction
RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Image file use in the application

Post by RK »

Hi,
Any further updates on this issue? I cant believe its been 12 days already and no response yet.

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

Image file use in the application

Post by Yurii Orishchuk »

Hi RK,

here is correct workflow:

1 Use Custom collection like "Images". With field "imageBase64" string type.

2 Store inside this "images" collection row with correct base64 source to image file.

3 Use read/list/query service to fetch row/rows from this collection.

4 In Success mapping link "imageBase64" response parameter to image component asset property.

Also if you can not get it to work - please show us your implementation on screen shots:

1 DB collection
2 Service response tab.
3 Service datasource "success" mapping.
4 How you invoke the service.

Regards.

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Image file use in the application

Post by RK »

Hi Yurii,
I have followed more or less the same steps. Please find below the screenshots. If there is anything else required please let me know.

I invoke the service on "Page Show" event as "restservice43.execute({});"

Image Image Image Image

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Image file use in the application

Post by RK »

just to add further, the encodedBase64 string, if put in an online decoder works as expected and shows the image properly. This means the encoded string is alright.
Also, there is a 'for' loop in the server code which has been done right now as a quick and dirty solution to show the error to you. Obviously this can be avoided if the image is assigned to 1 asset only.
Anxiously waiting for a resolution to this.

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Image file use in the application

Post by RK »

Hi,
Can someone please address this? Is it a bug?

maxkatz
Posts: 0
Joined: Fri Aug 13, 2010 3:24 pm

Image file use in the application

Post by maxkatz »

You need to add this JavaScript when you map a base64 string to the image:

return "data:image/png;base64," + value;

Also, it is better to use the Files collection to store binary data.

RK
Posts: 0
Joined: Sat May 23, 2015 6:40 pm

Image file use in the application

Post by RK »

Thanks Max. It works!!! Much appreciated.

Post Reply