Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

Makhlouf's avatar
Makhlouf
Explorer | Level 3
6 years ago

Programmatically download a shared file using C++ Curl

Hi,

I developped an aplication in C++ that runs on Windows. I am trying to add a feauture in the program to download a shared file from my dropbox folder. I would like the downloading to go in background in similar way to windows API URLDownloadToFile(). The windows function downloads files from the web. But when I use the dropbox file link, the function downloads an html file instead of my file. I tried to use CURL library but got stuck with the access_token. I created an application access_token as described by Dropbox developper guide. When I use this access_token I receive authorization faliure error message. I wonder if the job I am trying to do is actually doable, and whether my approach is the right one. Where should I go or what should I do to get a shared file downloaded with my windows application. 

Thanks for your help

14 Replies

Replies have been turned off for this discussion
  • Здравко's avatar
    Здравко
    Legendary | Level 20
    6 years ago

    I can confirm that your code works using either "raw=1" or "dl=1" endings. Seems you have network issues. That's it. ( Of course could be done some improvements in the code, like detect and automatically save in corresponding file, accordingly named file for example :wink: )

    Good luck!

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Makhlouf In case it helps with your the networking troubleshooting, note that the redirects to get to the file data when using 'raw=1' or 'dl=1' also go through other Dropbox domains that look like '*.dl.dropboxusercontent.com'.

  • Makhlouf's avatar
    Makhlouf
    Explorer | Level 3
    6 years ago
    Dear Здравко, 1- Can you advise me where I can download a libcurl.dll file that should work for me. I need to make sure whether the issue source is the network or missing option in the library. 2- Also, I could not follow you regarding the improvement you suggested to my code. What do you mean by automatically save in corresponding file. Please explain more. Thanks a lot.

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!