Skip to main content
Question

File preview feature

  • May 22, 2025
  • 2 replies
  • 67 views

Forum|alt.badge.img

Hi, 

 

I am new to Box, please help me how to approach for file preview feature. I have created a file in my box developer account, i would like to preview that file using Box Java SDK and developer token.Please guide me in right direction. 

 

 

Thanks,

Sonal

2 replies

Forum|alt.badge.img

Hey  - thanks for reaching out. There are two ways you can do this. 

 

  1. The first is to embed the file preview as an iframe. Box allows you to obtain a URL that you can use to display a file within an iframe. You can find that method in the Java SDK here: https://github.com/box/box-java-sdk/blob/master/doc/files.md#get-an-embed-link
  2. The second (and more robust) is to use the Box Content Preview UI Element, which is a Javascript library for displaying file previews in the client. Using Content Preview, you can initialize the library and provide an access token (in this case, your developer token) and a file ID and then a file preview will display. You can see more details for using Box Content Preview here: https://developer.box.com/docs/box-content-preview

Please let me know if you have any additional questions! 

 

 


Forum|alt.badge.img

this is confusing