Read an img from library in a Web App

imanousar
Level 3
Read an img from library in a Web App

I 'm trying to access my img uploaded in the project and print it in a web app but I can load it for some reason.

 

image= dbc.Col([
html.Img(src="/app/dataiku/DSS_DATA_DIR/config/projects/<project_name>/lib/img/<my_img.png>", alt="img_didn't load")
])

0 Kudos
1 Reply
Turribeach

You can't reference full paths like that from a Webapp, if you could it would extremely insecure as any malicious JavaScript could read them too. 

For statis files you have to put them in a specific folder:

https://developer.dataiku.com/latest/tutorials/webapps/standard/custom-static-files-kb/index.html

Thanks,

Christian

0 Kudos