Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
neunygph
10 years agoExplorer | Level 4
Getting multiple thumbnails of multiple files at once ?
Is it possible to retrieve multiple thumbnails of multiple files at once ? I tried to make a request to https://photos.dropbox.com/thumbnails_batch just like the guide from https://blogs.dropbox.com/...
neunygph
10 years agoExplorer | Level 4
Hi Greg,
I was able to implement the get/post thumbnails end point with "https://content.dropboxapi.com/2/files/get_thumbnail?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%20%22%2Ftest.jpg%22%2C%22format%22%3A%20%22jpeg%22%2C%22size%22%3A%20%22w64h64%22%7D" successfully, but the returned data is a raw data.
For instance if I paste this "https://content.dropboxapi.com/1/thumbnails/auto/test.jpg?size=s&access_token={mytoken} into the address bar from a browser, I can be able to see the image directly from the browser.
But if I do the same step with this "https://content.dropboxapi.com/2/files/get_thumbnail?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%20%22%2Ftest.jpg%22%2C%22format%22%3A%20%22jpeg%22%2C%22size%22%3A%20%22w64h64%22%7D", I can not see the image directly from the browser, and it will download raw data instead of showing the image i want to see on the browser.
Am I missing any step and/or arg or that's how it should be and there is no way we can display image directly on a browser with endpoint v2 ?
I was able to implement the get/post thumbnails end point with "https://content.dropboxapi.com/2/files/get_thumbnail?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%20%22%2Ftest.jpg%22%2C%22format%22%3A%20%22jpeg%22%2C%22size%22%3A%20%22w64h64%22%7D" successfully, but the returned data is a raw data.
For instance if I paste this "https://content.dropboxapi.com/1/thumbnails/auto/test.jpg?size=s&access_token={mytoken} into the address bar from a browser, I can be able to see the image directly from the browser.
But if I do the same step with this "https://content.dropboxapi.com/2/files/get_thumbnail?authorization=Bearer%20ACCESS_TOKEN_HERE&arg=%7B%22path%22%3A%20%22%2Ftest.jpg%22%2C%22format%22%3A%20%22jpeg%22%2C%22size%22%3A%20%22w64h64%22%7D", I can not see the image directly from the browser, and it will download raw data instead of showing the image i want to see on the browser.
Am I missing any step and/or arg or that's how it should be and there is no way we can display image directly on a browser with endpoint v2 ?
Greg-DB
Dropbox Community Moderator
10 years agoThanks! That behavior is expected (potentially dependent on the browser itself though) because the browser doesn't know that the data is an image it can display in the v2 case.
Is that your app's actual use case though? That is, would the user be opening these in their browser directly like this (as opposed to say, using it in an img src)?
Is that your app's actual use case though? That is, would the user be opening these in their browser directly like this (as opposed to say, using it in an img src)?
- neunygph10 years agoExplorer | Level 4Hi Greg,
Yea, it is my app actual use case. I'm trying to display multiple thumbnails of photo from users selected folder or root folder when they open a page, regardless root folder or sub directories. It would take longer to load the whole page if we have to go through image processing from raw data, imagine if a user selects a sub folder with hundreds or thousands of photos, then I would have to process/download hundreds or thousands time to handle the photo from returned raw data.
The performance/page load time would be much better if I can get photo url or image/jpg or image/png content type. That's why I"m trying to find a way to display photo directly in browser from api response. - Greg-DB10 years ago
Dropbox Community Moderator
I see, thanks for the context!
For reference, while the browser will download the file when the URL is accessed directly due to the Content-Type, it looks like using it as a src for an img tag does work, so that may be a usable solution. (Again though, make sure you don't leak the access token to other users.) - neunygph10 years agoExplorer | Level 4Thanks for the tips and advice. I will give it a try :)
- Greg-DB9 years ago
Dropbox Community Moderator
I just wanted to follow up on this to let you know that the Dropbox API now offers the ability to get thumbnails in batches:
https://www.dropbox.com/developers/documentation/http/documentation#files-get_thumbnail_batch - neunygph9 years agoExplorer | Level 4
Oh this is a great news, thanks Greg for the update.
Phuong
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!