Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Check if file exist for form curl.

Custom Title Activated
Loyal Member
Joined
Mar 26, 2012
Messages
1,465
Reaction score
131
I want to simply see if a file exists so that it will add another formadd for CURL in C++. Any help would be appreciated. Here is my code so far but, need help.

Code:
CURL *curl;

    struct curl_httppost *formpost = NULL;
    struct curl_httppost *lastptr = NULL;

    curl_global_init(CURL_GLOBAL_ALL);

	curl_formadd(&formpost,
        &lastptr,
        CURLFORM_COPYNAME, "image",
        CURLFORM_FILE, "1stfile.txt",
        CURLFORM_END);

	if(ifstream("2ndfile.txt")){
	curl_formadd(&formpost,
        &lastptr,
        CURLFORM_COPYNAME, "image",
        CURLFORM_FILE, "2ndfile.txt",
        CURLFORM_END);
	}
	curl_formadd(&formpost,
        &lastptr,
        CURLFORM_COPYNAME, "submit",
        CURLFORM_COPYCONTENTS, "submit",
		CURLFORM_END);

	
    curl = curl_easy_init();
 
Back
Top