Read an img from library in a Web App
Ioannis
Dataiku DSS Core Designer, Dataiku DSS ML Practitioner, Dataiku DSS Adv Designer, Registered Posts: 28 ✭✭✭✭✭
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")
])
Answers
-
Turribeach Dataiku DSS Core Designer, Neuron, Dataiku DSS Adv Designer, Registered, Neuron 2023 Posts: 2,139 Neuron
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