cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
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.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group