Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
Penka V.
10 years agoNew member | Level 1
Dropbox API file preview - check the preview content type
Hi,
I am using the Dropbox SDK for Java. I understand that the the get_preview will return either html or pdf based on the file type. Is there a rule that specifies what is the preview content type...
Greg-DB
Dropbox Community Moderator
10 years agoThanks for the report Penka! You're right, it looks like we don't currently return a good indicator of the format used for the preview.
That endpoint does return either HTML or PDF, and that could change for any given sort of file over time, so the right way to handle this is to check the returned format on the fly. I'm sending this along to the team to see how we may be able to expose this properly so you don't have to do the string check you described.
Greg-DB
Dropbox Community Moderator
8 years agoApologies for not following up on this sooner. I just wanted to update this to let you know we now officially document which file types give which preview type:
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getPreview-java.lang.String-
https://dropbox.github.io/dropbox-sdk-java/api-docs/v3.0.x/com/dropbox/core/v2/files/DbxUserFilesRequests.html#getPreview-java.lang.String-
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.
If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!