 <p>THIS is the right way to do it.</p> <p>One more thing to keep in mind is that you MUST set the FILE SIZE:</p> <pre><code>curl_easy_setopt(curlHandle, CURLOPT_INFILESIZE,(curl_off_t)putData.size); </code></pre> <p>Otherwise your server might throw an error stating that the request length wasn't specified.</p> <p>putData is an instance of the put_data structure.</p>