使用libcurl将文件上传到DropBox

使用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);
    }