We’re Still Here to Help (Even Over the Holidays!) - find out more here.
Forum Discussion
Harsh S.1
11 years agoNew member | Level 1
How to download thumbnail/image file
Hi
I am using the python requests library to request a particular thumbnail from my dropbox. My request receives a 200 response. However, how do i use this response object to actually display/save the thumbnail ? Any help will be greatly appreciated.
4 Replies
Replies have been turned off for this discussion
- Greg-DB11 years ago
Dropbox Community Moderator
When you receive a 200 status code from this endpoint, it indicates that the API call was successful, and the body will contain the thumbnail data. Exactly how you display that is up to your app though. For example, you might save that raw data to a local file, etc.
- Harsh S.111 years agoNew member | Level 1
Hi Gregory. Thanks for your prompt reply.
Let me rephrase my question a little. What property/method can i call on the response object that would give me the data i need to either save it as an image file or make it appear as a picture on my site.
- Harsh S.111 years agoNew member | Level 1
The dropbox api explorer returns a button with a link to download the thumbnail. How do i get that link or download source programmatically ?
- Steve M.11 years ago
Dropbox Staff
I think your question is just about how to use the requests library, so this probably isn't the best place to ask for help.
That said, here's a simple example of how to read the content from a URL using requests:
import requests
response = requests.get('http://www.example.com')
print(response.content)
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!