File tree Expand file tree Collapse file tree 1 file changed +6
-12
lines changed
Expand file tree Collapse file tree 1 file changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -86,21 +86,15 @@ class CurlConnectionHandler
8686 {
8787 m_writtenData = " " ;
8888
89- struct curl_httppost *formpost = NULL ;
90- struct curl_httppost *lastptr = NULL ;
9189 CURLcode res;
9290
93- curl_formadd (&formpost,
94- &lastptr,
95- CURLFORM_COPYNAME, " json_file" ,
96- CURLFORM_FILE, fileName.c_str (),
97- CURLFORM_END);
98-
99- curl_easy_setopt (m_curl, CURLOPT_HTTPPOST, formpost);
100-
91+ curl_mime *mime = curl_mime_init (m_curl);
92+ curl_mimepart *mimePart = curl_mime_addpart (mime);
93+ curl_mime_name (mimePart, " json_file" );
94+ curl_mime_filedata (mimePart, fileName.c_str ());
95+ curl_easy_setopt (m_curl, CURLOPT_MIMEPOST, mime);
10196 res = curl_easy_perform (m_curl);
102-
103- curl_formfree (formpost);
97+ curl_mime_free (mime);
10498
10599 if (res != CURLE_OK)
106100 return false ;
You can’t perform that action at this time.
0 commit comments