Forum Discussion

Harsh S.1's avatar
Harsh S.1
New member | Level 1
11 years ago

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-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    11 years ago

    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.1's avatar
    Harsh S.1
    New member | Level 1
    11 years ago

    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.1's avatar
    Harsh S.1
    New member | Level 1
    11 years ago

    The dropbox api explorer returns a button with a link to download the thumbnail. How do i get that link or download source programmatically ?

  • 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

Node avatar for 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!