We want to post files to web server through https post. we successfully post small files to web sever, but when we post big file(lager than 10MB), we receive this error:
- SSL read: error:00000000:lib(0):func(0):reason(0), errno 10054
- Curl_http_done: called premature == 1
- Closing connection 0
libcurl version: 7.50.3
open ssl version: openssl-1.0.1t.
We have already modifed the configuration of post size on the web server. We can post big files through web page, but, at the same time, we can't post big file through libcurl with https post. Anything we can do with this? Thanks very much!
The options we are setting for the POST are shown below:
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();