Your workflow is unique 👨💻 - tell us how you use Dropbox here.
Forum Discussion
KennelLink
9 years agoExplorer | Level 3
How to show in-browser view of a file (i.e. jpg or PDF)
The URL from get_temporary_link() forces Firefox to initiate a download instead of an in-browser view of the file (which is what I want) and it is causing IE to just show a blank window. The create_shared_link does not allow an expiry for basic accounts, but I don't want to create a permanent share link for every file the user happens to view. How can I open a window in the browser that shows a file from the user's box? There seem to be two ways to display file: 1) using Dropbox's web view (given by create_shared_link) and 2) using the browser's native ability to show the file type. I want the ability to do both, but can't get either one working.
3 Replies
- Greg-DB9 years ago
Dropbox Community Moderator
The links returned by get_temporary_link aren't intended for being directly displayed in the browser unfortunately, but I'll be sure to pass this along as a feature request. - KennelLink9 years agoExplorer | Level 3
Thanks Greg. In v1 of the API we could get a temporary shared link (lasting four hours) and use that with a slight tweak to show the file in the browser. Is there no equivalent feature, have we lost that capability, in v2?
In v2, the /create_shared_link_with_settings would be the correct end-point to get the URL for in-browser viewing, however it does not allow me to get an expiring link since our users usually have basic accounts. So must I create a permanent shared link for every file the user views?
- Greg-DB9 years ago
Dropbox Community Moderator
It sounds like you're referring to API v1's /media endpoint. The API v2 equivalent is /files/get_temporary_link, but unfortunately it's not designed for displaying directly in the browser. Sorry I don't have a better answer for you!
About Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.
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!