cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Should we modify the Sharing experience to reduce the steps it takes to share files and folders? Tell us your thoughts right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
1
Ask
2
Reply and help

Programmatically download a shared file using C++ Curl

Re: Programmatically download a shared file using C++ Curl

Makhlouf
Explorer | Level 3

Dear Ð—дравко,

Yes, I tried it and got me same error (6) CURL_COUDNT_RESOLVE_HOST.

There is one observation to mention here.

If I comment the line: curl_easy_setopt (curl,CURLOPT_FOLLOWLOCATION,1) ; the function curl_easy_perform () returns 0 which means no error, but the file size is 0 bytes.

When I decomment the above line, curl_easy_perform () returns 6. and the file size is still 0 bytes.

 

Re: Programmatically download a shared file using C++ Curl

Здравко
Super Collaborator | Level 20

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!

Re: Programmatically download a shared file using C++ Curl

Greg-DB
Dropboxer

@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'.

Re: Programmatically download a shared file using C++ Curl

Makhlouf
Explorer | Level 3
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.

Re: Programmatically download a shared file using C++ Curl

Здравко
Super Collaborator | Level 20

Hi @Makhlouf,

All you need (including sourcing, binary and tutorials) is here: https://curl.haxx.se/

Again, Good luck!

ADD: As lib curl is a C library, but you are trying C++ coding, might be better take a look here: http://www.curlpp.org/ also.

Who's talking

Top contributors to this post

  • User avatar
    Здравко Super Collaborator | Level 20
  • User avatar
    Makhlouf Explorer | Level 3
  • User avatar
    Greg-DB Dropboxer
What do Dropbox user levels mean?
Need more support?