cURL / Mailing Lists / curl-library / Single Mail


Establish the FTP Connection and file Transfer from on location to other

From: Amol Madane <>
Date: Tue, 6 Apr 2010 10:03:41 +0530


My aim is to establish the FTP connection and transfer the file from one
location to other on QNX.
The code that i have written is

#include <stdio.h>
#include <unistd.h>
#include <curl.h>
#include <cstdlib>
#include <iostream>

int main(int argc, char **argv)
        int return_global_init;
        CURL *curl;
        //CURLcode res;
        struct curl_slist *slist=NULL;
        slist = curl_slist_append(slist, "put");
        // slist = curl_slist_append(slist, "pwd");
        // slist = curl_slist_append(slist, "pwd");
        // slist = curl_slist_append(slist, "chmod 777 11.txt");
        // slist = curl_slist_append(slist, "GK");
        //slist = curl_slist_append(slist, "TO");
        // slist = curl_slist_append(slist, "22.txt");

        if (return_global_init==0)
                curl = curl_easy_init();
                if (curl)
                        std::cout << "Error No - 1" << curl_easy_setopt
(curl, CURLOPT_URL, "")<< 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;
                        //curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV,
                        //curl_easy_setopt (curl, CURLOPT_FTP_USE_EPRT,
                        curl_easy_setopt (curl, CURLOPT_USE_SSL,
                        curl_easy_setopt (curl, CURLOPT_SSL_VERIFYPEER,
                        curl_easy_setopt (curl, CURLOPT_SSL_VERIFYHOST,
                        std::cout << "Error No - 5" << curl_easy_setopt
(curl, CURLOPT_QUOTE , slist) << std::endl;
                        curl_easy_setopt(curl, CURLOPT_POSTQUOTE, slist);

But it is not giving me proper output.

Any help in finding a solution would be greatly appreciated.!!!!!!!!!


Amol Raoji Madane
Tata Consultancy Services
DLF Akruti Info Park,
PN 28,
Rajiv Gandhi Infotech Park Hinjewadi, PHASE II
Pune - 411057,Maharashtra
Ph:- +91-20-6675-2352
Buzz:- 420-2352
Experience certainty. IT Services
                        Business Solutions
Notice: The information contained in this e-mail
message and/or attachments to it may contain
confidential or privileged information. If you are
not the intended recipient, any dissemination, use,
review, distribution, printing or copying of the
information contained in this e-mail message
and/or attachments to it are strictly prohibited. If
you have received this communication in error,
please notify us by reply e-mail or telephone and
immediately and permanently delete the message
and any attachments. Thank you

List admin:
Received on 2010-04-06