Page 2 of 2

Image file use in the application

Posted: Tue Jul 28, 2015 1:50 am
by RK

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


Image file use in the application

Posted: Wed Jul 29, 2015 1:05 am
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.


Image file use in the application

Posted: Wed Jul 29, 2015 4:30 pm
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


Image file use in the application

Posted: Wed Jul 29, 2015 5:57 pm
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.


Image file use in the application

Posted: Thu Jul 30, 2015 5:00 pm
by RK

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


Image file use in the application

Posted: Thu Jul 30, 2015 6:39 pm
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.


Image file use in the application

Posted: Fri Jul 31, 2015 5:10 pm
by RK

Thanks Max. It works!!! Much appreciated.