You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Mathias W.3
9 years agoNew member | Level 2
API v2: Simple image gallery on my website using dropbox
Hey everybody,
is there a simple way to list all files of a folder with thumbnails on my website with php? I'd like to upload / manage the photos or files through dropbox and want to output them on...
- 9 years ago
Apologies, I wasn't clear before. Even if you don't specify the format, the returned data is already the jpeg data for the thumbnail for the file. In either case though, that is, for png or jpeg thumbnails, the thumbnail data will be returned directly in the response of the API call as binary data.
It sounds like you want to display these thumbnails directly in an img tag, in which case you will need to base64 encode it for a data URI as you showed, or save it to your server and serve it from a URL you can use in the img src.
I'm not sure what the issue may be when you say that when you "display the image in a modal box the image opens in a new window". That sounds like it may be outside the scope of the Dropbox API itself though, since the API call already succeeded and returned the thumbnail data at that point.
Perhaps you'd prefer an API endpoint that returns thumbnail links, instead of thumbnail data? I'll send that along as a feature request too.
Greg-DB
Dropbox Staff
Apologies, I wasn't clear before. Even if you don't specify the format, the returned data is already the jpeg data for the thumbnail for the file. In either case though, that is, for png or jpeg thumbnails, the thumbnail data will be returned directly in the response of the API call as binary data.
It sounds like you want to display these thumbnails directly in an img tag, in which case you will need to base64 encode it for a data URI as you showed, or save it to your server and serve it from a URL you can use in the img src.
I'm not sure what the issue may be when you say that when you "display the image in a modal box the image opens in a new window". That sounds like it may be outside the scope of the Dropbox API itself though, since the API call already succeeded and returned the thumbnail data at that point.
Perhaps you'd prefer an API endpoint that returns thumbnail links, instead of thumbnail data? I'll send that along as a feature request too.
Mathias W.3
9 years agoNew member | Level 2
You're right. The API works correctly. Now I even understand how it works. :)
The modal-window-problem is not really a matter of dropbox, but I hoped you still got a hint for me. I thought it is maybe an issue because of the base64 encoding in the img tag. I'll search somewhere else for a solution. ;)
Thanks for your help and explanation.
Matthew.
- rodrigolinkweb8 years agoNew member | Level 2
Hello Mathias, are you brazilian?
Can you please help me with this question?
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,910 PostsLatest Activity: 3 days agoIf 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 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!