#include #include #include #include #include #define UPLOAD_FILE_AS "11.txt" int main(int argc, char **argv) { int return_global_init; CURL *curl; static const char buf_1 [] = "RETR " UPLOAD_FILE_AS; static const char buf_2 [] = "PORT ";// "PORT " "172,29,59,199,244,142"; //CURLcode res; return_global_init=curl_global_init(CURL_GLOBAL_ALL); /*struct curl_slist *slist=NULL; slist = curl_slist_append(slist, "MKDIR test");*/ struct curl_slist* commands = NULL ; // struct curl_slist* commands1 = NULL ; commands = curl_slist_append( commands , buf_1 ) ; commands = curl_slist_append( commands , buf_2 ) ; if (return_global_init==0) { curl = curl_easy_init(); if (curl) { curl_easy_setopt(curl, CURLOPT_UPLOAD, 1L); std::cout << "Error No - 1" << curl_easy_setopt (curl, CURLOPT_URL, "ftp://172.29.59.216/")<< std::endl; std::cout << "Error No - 2" << curl_easy_setopt (curl, CURLOPT_VERBOSE, 1)<< std::endl; std::cout << "Error No - 3" << curl_easy_setopt (curl, CURLOPT_USERNAME , "gaurav")<< std::endl; std::cout << "Error No - 4" << curl_easy_setopt (curl, CURLOPT_PASSWORD ,"gaurav")<< std::endl; std::cout << "Error No - 5" < USER gaurav < 331 Password required for gaurav. > PASS gaurav < 230- < Welcome to QNX Neutrino! < 230 User gaurav logged in. > PWD < 257 "/home/gaurav" is the current directory. * Entry path is '/home/gaurav' * Uploading to a URL without a file name! * Closing connection #0 * URL using bad/illegal format or missing URL #--=_mixed 003B36A06525770A_Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------- List admin: http://cool.haxx.se/list/listinfo/curl-library Etiquette: http://curl.haxx.se/mail/etiquette.html