Database image as background image CSS

Database image as background image CSS

  

Hello,


I have one image saved in database as binary and i want to add it to the css property "background". The way that i found was with: "background: url(data:image/png;base64,<base64 image content>)".


I tried to add it via inline style however OutSystems truncates the string (e.g. it only appears "background: url(data:image/png)"), and because of this the image is not loaded.


Anyone have any idea what the plaform does in this situation and what is the solution for this problem.


Note: I now that inline style is not the best practice however in this case for design purposes i really need it!


Best regards,


Rui Gomes


Rui Gomes wrote:

Hello,


I have one image saved in database as binary and i want to add it to the css property "background". The way that i found was with: "background: url(data:image/png;base64,<base64 image content>)".


I tried to add it via inline style however OutSystems truncates the string (e.g. it only appears "background: url(data:image/png)"), and because of this the image is not loaded.


Anyone have any idea what the plaform does in this situation and what is the solution for this problem.


Note: I now that inline style is not the best practice however in this case for design purposes i really need it!


Best regards,


Rui Gomes


Hi Rui,

In silk, we have one widget called card background please check if it solves your problem.

you can also check how they have implemented this.

Regards,

Pankaj