Need to see if your shared folder is taking up space on your dropbox 👨💻? Find out how to check here.
Forum Discussion
hb_
7 years agoHelpful | Level 5
Upload a file using c++ via curl
Hi, I was googling for a way to upload a file to any cloud storage using c++ and came across dropbox api. I found the code, so I did a copy and paste to try and see if it works. I entered the Access ...
Здравко
7 years agoLegendary | Level 20
Hi hb_,
Definitely the problem is not in cited code line. Did you set properly CURLOPT_XOAUTH2_BEARER parameter? :thinking:
Hope this gives some direction. :wink:
- hb_7 years agoHelpful | Level 5
Здравко Thank you. You were right, I guess this time I set CURLOPT_XOAUTH2_BEARER parameter properly so it gave another error:
"Error in call to API function "files/upload": Must provide HTTP header "Authorization" or URL parameter "authorization"."
I am searching to find out what this error could be about.
If you can help in any way I would much appreciate.
- hb_7 years agoHelpful | Level 5
hey Здравко I think it worked
However I came to find that the code does not do what I actually want, what it does is just creates a new file and write something you specify to it but I want to upload a local file from my computer to my dropbox account?
Any idea how can I do that?
- Здравко7 years agoLegendary | Level 20
Hey hb_,
Seems you have some progress. :wink: Most upload operations (no restricted to Dropbox) are POST based. It would be difficult (and impractical) to encode big file's content to GET parameters! :stuck_out_tongue_closed_eyes: Further, every content is transferred as... content and you have to direct where this content to be placed on. The target file name could be the same as source file name (if any) or different. :wink: The choice is yours! I'm not sure where you read reference info for CURL, but curl.haxx.se is good starting point and together with Dropbox API (also SDK) documents you can do what you want. Between: libcurl is C library, not C++ (as in your thread header).
Of course would be nice if there was Dropbox C/C++ SDK. It's really curious why 'fundamental' languages C and C++ are left without proper support from Dropbox side. There are many libraries providing underlying transport support that could be used as base for Dropbox 'shell'. For example Qt, WxWidgets, Boost and many others. Of course libcurl, discussed here, is also good example. This thread could be a proposal! Greg-DB, What you would say about? :sunglasses:
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!