1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
//info from file when object initialized
if (file.is_open()) {
while (file >> myExample::username >> myExample::password >> myExample::someDate) {}
}
file.close();
//post image & member data, etc. to server
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "imageUpload",
CURLFORM_FILE, myExample::testImage, CURLFORM_END);
std::string foo = "bar";
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "fooBar",
CURLFORM_COPYCONTENTS, &foo, CURLFORM_END);
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "user",
CURLFORM_COPYCONTENTS, myExample::username, CURLFORM_END);
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "pass",
CURLFORM_COPYCONTENTS, myExample::password, CURLFORM_END);
curl_formadd(&formpost, &lastptr, CURLFORM_COPYNAME, "time",
CURLFORM_COPYCONTENTS, std::to_string(myExample::someDate), CURLFORM_END);
|