cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
cancel
Showing results for 
Search instead for 
Did you mean: 

Display Html from dbfs files

seboz123
New Contributor II

Hi,

I want to display some content from dbfs inside my notebook. Let's say I have a image under: /dbfs/mnt/test-bucket/test-custom/sample.png

I want to embed that into my Notebook Html Output like this:

displayHTML("""<img src ='/dbfs/mnt/test-bucket/test-custom/sample.png'>""")

But the image does not show up. In the browser console, I see a Error 401 with access denied?

Any help is appreciated.

3 REPLIES 3

Anonymous
Not applicable

@Sebastian Schueler​ :

The error you are seeing is likely due to a permissions issue. By default, files in DBFS are private and can only be accessed by the user who uploaded them. To display an image in the notebook, you will need to make sure that the file is accessible to the user who is running the notebook.

Anonymous
Not applicable

Hi @Sebastian Schueler​ 

Hope everything is going great.

Just wanted to check in if you were able to resolve your issue. If yes, would you be happy to mark an answer as best so that other members can find the solution more quickly? If not, please tell us so we can help you. 

Cheers!

seboz123
New Contributor II

Hi @Vidula Khanna​ ,

unfortunately not. I can access the file through the notebook via e.g.

!ls /dbfs/mnt/test-bucket/test-custom/ 

but it cannot be displayed via the displayHTML, with the 401.

Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.