CURL *curl; curl = curl_easy_init(); std::ofstream file; file.open("test.pdf"); if(curl != NULL){ curl_easy_setopt(curl, CURLOPT_ERRORBUFFER,m_errorBuffer); curl_easy_setopt(curl, CURLOPT_URL,url); curl_easy_setopt(curl, CURLOPT_HEADER,0); curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, &OasE::writeToBuffer); curl_easy_setopt(curl, CURLOPT_WRITEDATA, &file); }