GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 18-Nov-2010, 09:59
detective
 
Posts: n/a

C++ ftp file upload


i need a working code that can upload a file

plzzzzzzzzz
  #2  
Old 18-Nov-2010, 10:08
LuciWiz's Avatar
LuciWiz LuciWiz is offline
Moderator
 
Join Date: Jul 2004
Location: Cluj-Napoca (Romania)
Posts: 1,037
LuciWiz is just really niceLuciWiz is just really niceLuciWiz is just really niceLuciWiz is just really nice

Re: C++ ftp file upload


Quote:
Originally Posted by detective
i need a working code that can upload a file

plzzzzzzzzz

You might want to expand on the question if you are hoping for a proper response: what have you tried so far? Are you just looking for an ftp library written in C/C++, or is this a homework assignment?

Best regards,
Lucian
__________________
Please read these Guidelines before posting on the forum

"A person who never made a mistake never tried anything new."
Einstein
  #3  
Old 18-Nov-2010, 11:12
detective
 
Posts: n/a

Re: C++ ftp file upload


CPP / C++ / C Code:
include <CkFtp2.h>
#include <CkString.h>

void ChilkatSample(void)
    {
    CkFtp2 ftp;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = ftp.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.put_Hostname("ftp.chilkatsoft.com");
    ftp.put_Username("****");
    ftp.put_Password("****");

    //  The default data transfer mode is "Active" as opposed to "Passive".

    //  Connect and login to the FTP server.
    success = ftp.Connect();
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Change to the remote directory where the file will be uploaded.
    success = ftp.ChangeRemoteDir("junk");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Upload a file.
    CkString localFilename;
    localFilename = "hamlet.xml";
    CkString remoteFilename;
    remoteFilename = "hamlet.xml";

    success = ftp.PutFile(localFilename,remoteFilename);
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.Disconnect();

    printf("File Uploaded!\n");
    }



this is the code at it is give alot of errors i m using this in console app
  #4  
Old 18-Nov-2010, 11:12
detective
 
Posts: n/a

Re: C++ ftp file upload


CPP / C++ / C Code:
include <CkFtp2.h>
#include <CkString.h>

void ChilkatSample(void)
    {
    CkFtp2 ftp;

    bool success;

    //  Any string unlocks the component for the 1st 30-days.
    success = ftp.UnlockComponent("Anything for 30-day trial");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.put_Hostname("ftp.chilkatsoft.com");
    ftp.put_Username("****");
    ftp.put_Password("****");

    //  The default data transfer mode is "Active" as opposed to "Passive".

    //  Connect and login to the FTP server.
    success = ftp.Connect();
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Change to the remote directory where the file will be uploaded.
    success = ftp.ChangeRemoteDir("junk");
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    //  Upload a file.
    CkString localFilename;
    localFilename = "hamlet.xml";
    CkString remoteFilename;
    remoteFilename = "hamlet.xml";

    success = ftp.PutFile(localFilename,remoteFilename);
    if (success != true) {
        printf("%s\n",ftp.lastErrorText());
        return;
    }

    ftp.Disconnect();

    printf("File Uploaded!\n");
    }



this is the code at it is give alot of errors i m using this in console app
  #5  
Old 18-Nov-2010, 11:14
detective
 
Posts: n/a

Re: C++ ftp file upload


this is the ready class or some kid of shit

i wana know the basic way of uploading file by using c++ some winsock stuff or some thing like this
  #6  
Old 18-Nov-2010, 11:23
detective
 
Posts: n/a

Re: C++ ftp file upload


this is the ready class or some kid of shit

i wana know the basic way of uploading file by using c++ some winsock stuff or some thing like this
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
CD burner wont burn!! robertli55 Computer Hardware Forum 1 18-Jun-2004 10:53
Yet another CD burner problem: Lite-On LSC-24082K Erwin Computer Hardware Forum 1 22-May-2004 11:28
Getting File Upload to work with CGI / C++ jjthebear Web Design Forum 0 20-May-2004 18:39
Can't view pages from another machine on the Intranet aevans Apache Web Server Forum 9 14-May-2004 02:26
CD Buring Failed skanth2000 Computer Hardware Forum 1 15-Nov-2003 04:52

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:30.


vBulletin, Copyright © 2000 - 2014, Jelsoft Enterprises Ltd.