libcurl https post 大文件 ssl 读取错误?

libcurl https post big file ssl read error?

我们想通过 https post 将文件 post 发送到 Web 服务器。 我们成功 post 小文件到网络服务器,但是当我们 post 大文件(大于 10MB)时,我们收到此错误:

libcurl 版本:7.50.3

开启ssl版本:openssl-1.0.1t。

我们已经在网络服务器上修改了 post 大小的配置。我们可以通过网页post大文件,但是,同时,我们不能通过libcurl和httpspostpost大文件。 我们能做些什么吗?非常感谢!

我们为 POST 设置的选项如下所示:

curl_global_init(CURL_GLOBAL_ALL);
CURL* hCurl = curl_easy_init();
if (hCurl != NULL)
{
    curl_httppost* pFormPost = NULL;
    curl_httppost* pLastElem = NULL;
    curl_formadd(&pFormPost, &pLastElem,
        CURLFORM_COPYNAME, "ufile01",
        CURLFORM_FILE, "vlc.rar",
        CURLFORM_CONTENTTYPE, "application/octet-stream",
        CURLFORM_END);
    curl_easy_setopt(hCurl, CURLOPT_HTTPPOST, pFormPost);
    curl_easy_setopt(hCurl, CURLOPT_URL, url);
    curl_easy_setopt(hCurl, CURLOPT_SSL_VERIFYPEER, 0L);
    curl_easy_setopt(hCurl, CURLOPT_SSL_VERIFYHOST, 0L);
    CURLcode res = curl_easy_perform(hCurl);
    if (res != CURLE_OK)
    {
        printf("Error");
    }
    curl_formfree(pFormPost);
    curl_easy_cleanup(hCurl);
}
curl_global_cleanup();

考虑检查 Web 服务器上的 POST 大小。 PHP可以通过post_max_size

调整