954,483 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

FTP Upload

Hey guys Im writing a app to upload files to my webserver so when i save a file locally it will upload when i open the app. Ive searched the internet for uploading libraries but none of them seem to work can someone shed a little light on this for me and maybe link me to some good libraries. Any help would be greatly appreciated. Thanks Cyb3r.

Cyb3rAssasin
Light Poster
29 posts since Dec 2007
Reputation Points: 11
Solved Threads: 0
 

There is a free FTP client source code here (scroll down to Socket Class section) Just download (free) the whole library and you will have it with examples.

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 
#include <iostream>
#include <CkUpload.h>

using namespace std;

void ChilkatSample(void)
{

    CkUpload upload;

    //  Specify the page (ASP, ASP.NET, Perl, Python, Ruby, CGI, etc)
    //  that will process the HTTP Upload.
    upload.put_Hostname("www.freeupload.com");
    upload.put_Path("/freeaspupload/testUpload.asp");

    //  Add one or more files to be uploaded.
    upload.AddFileReference("file1","dude.gif");
    upload.AddFileReference("file2","pigs.xml");
    upload.AddFileReference("file3","sample.doc");

    //  Do the upload.  The method returns when the upload
    //  is completed.
    //  This component also includes asynchronous upload capability,
    //  which is demonstrated in another example.
    bool success;
    success = upload.BlockingUpload();
    if (success != true) {
        printf("%s\n",upload.lastErrorText());
    }
    else {
        printf("Files uploaded!\n");
    }

}


I found this script at but I cant seem to get it to work I keep getting the following errors.
[Linker error] undefined reference to `CkUpload::CkUpload()'
[Linker error] undefined reference to `CkUpload::put_Hostname(char const*)'
[Linker error] undefined reference to `CkUpload::put_Path(char const*)'
[Linker error] undefined reference to `CkUpload::AddFileReference(char const*, char const*)'
[Linker error] undefined reference to `CkUpload::AddFileReference(char const*, char const*)'
[Linker error] undefined reference to `CkUpload::AddFileReference(char const*, char const*)'
[Linker error] undefined reference to `CkUpload::BlockingUpload()'
[Linker error] undefined reference to `CkUpload::lastErrorText()'
[Linker error] undefined reference to `CkUpload::~CkUpload()'
[Linker error] undefined reference to `CkUpload::~CkUpload()'
ld returned 1 exit status
C:\Dev-Cpp\Makefile.win [Build Error] [Upload.exe] Error 1

Im really stuck on this do you guys have any insight on this?

Cyb3rAssasin
Light Poster
29 posts since Dec 2007
Reputation Points: 11
Solved Threads: 0
 

you are missing the implementation file of that class, most likely in CkUpload.cpp

Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You