Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
Hi,
I am tryng to display pdf on my website but I try to use files_get_preview function, download but only think I can Fetch the data but not displaying in an embed/iframe.
I have those erros; "unsupported extension" and "a frame because it set 'X-Frame-Options' to 'deny'."
How can I display a simple PDF on my site?
Thx
Jay
Community Moderator @ Dropbox
dropbox.com/support
Did this post help you? If so, give it a Like below to let us know.
Need help with something else? Ask me a question!
Find Tips & Tricks Discover more ways to use Dropbox here!
Interested in Community Groups? Click here to join!
Is not working I'll paste the code for any suggestion
dbx.filesListFolder({path: '/folder_name}) .then(function(response) { if(response){ var a = [] response.entries.map((r, i) => { console.log(r.name) return a.push(r.path_display) }) self.setState({name: a}) } }) .catch(function(error) { console.log(error); });
I tryed using filesDownload aswell but the same
Jay
Community Moderator @ Dropbox
dropbox.com/support
Did this post help you? If so, give it a Like below to let us know.
Need help with something else? Ask me a question!
Find Tips & Tricks Discover more ways to use Dropbox here!
Interested in Community Groups? Click here to join!
The filesListFolder method you included in your code is just for listing files and folders; it doesn't itself offer access to file data.
Also, the 'https://www.dropbox.com/home/folder/...' kind of URLs you mentioned are private URLs for your account. You can't use them to embed file data. Jay was referring to getting a shared link (e.g., via the Dropbox web site, or via the Dropbox API), and modifying it for direct access.
If you're using the API via the JavaScript SDK and want to retrieve the original file data, you should use the filesDownload method. E.g., you can use that to get the PDF data for a PDF file. (This is distinct from the shared link functionality noted above.)
If the file isn't already a PDF but you want a PDF version of it, you can use the filesGetPreview method, if the file is a supported type (see the docs for information).
In any case though, these method only gives you the data. They do not offer a mechanism for embedding that data on web site. That's a more general web development question, not specific to Dropbox, so I can't offer guidance on that in particular.
Hi there!
If you need more help you can view your support options (expected response time for a ticket is 24 hours), or contact us on X or Facebook.
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!