使用libcurl将文件上传到DropBox [英] Using libcurl to upload files to DropBox

查看:299
本文介绍了使用libcurl将文件上传到DropBox的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在C / C ++应用程序中使用libcurl将文件发布到DropBox。

I'm trying to use the libcurl in a C/C++ application to post files to DropBox.

我想使用/ files(POST)API,如下所示:

I would like to use the "/files (POST)" API as documented here...

https://www.dropbox.com/developers/reference/api#files-POST

我在正确验证(OAuth)此通话时遇到问题。我不清楚如何正确创建身份验证签名。

I am having problems with properly authenticating (OAuth) this call. It is unclear to me how to properly create the authentication signature.

从我看到的一个示例中,它看起来像是在整个文件中读取以创建HMAC- SHA1编码。这对大文件似乎有问题。

From some a sample I saw, it looked like they were reading in the whole file to create the HMAC-SHA1 encoding on. This seems problematic on large files.

有没有人有使用这个API或类似的经验或洞察力?

Does anyone have experience or insight using this API or something similar?

推荐答案

我刚刚使用libouth和libcurl从sina weibo获取信息。这里是我的例子为你介绍。你也可以在测试中引用liboauth测试程序dir,oauthtest.c

I have just use the libouth and libcurl to get information from sina weibo. here is my example for you refer. you can also refer the liboauth test programmer in the tests dir, oauthtest.c

    if (use_post)
    {
        req_url = oauth_sign_url2(test_call_uri, &postarg, OA_HMAC, NULL, c_key, c_secret, t_key, t_secret);
        reply = oauth_http_post(req_url,postarg);
    } 

这篇关于使用libcurl将文件上传到DropBox的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆